add emailwhitelist model

This commit is contained in:
Trent Palmer 2021-03-05 17:19:28 -08:00
parent 7411fcc1ec
commit 356b825830
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 3.1.7 on 2021-03-06 01:08
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='EmailWhiteList',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('email', models.EmailField(max_length=254, unique=True)),
],
options={
'abstract': False,
},
),
]

View File

@ -3,6 +3,13 @@ from tp.models import UUIDAsIDModel
from django.contrib.auth.models import User from django.contrib.auth.models import User
class EmailWhiteList(UUIDAsIDModel):
email = models.EmailField(unique=True)
def __str__(self):
return self.email
class Account(UUIDAsIDModel): class Account(UUIDAsIDModel):
user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True) user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True)
totp_key = models.CharField(max_length=16, null=True) totp_key = models.CharField(max_length=16, null=True)