mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-24 02:11:30 -08:00
add emailwhitelist model
This commit is contained in:
parent
7411fcc1ec
commit
356b825830
24
accounts/migrations/0002_emailwhitelist.py
Normal file
24
accounts/migrations/0002_emailwhitelist.py
Normal 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,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user