From 8433d8bf41ff13ce4d88fb8a24d35535b76ad7cd Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 2 Oct 2020 14:56:37 -0700 Subject: [PATCH] Make user email addresses unique --- bookwyrm/migrations/0050_auto_20201002_2156.py | 18 ++++++++++++++++++ bookwyrm/models/user.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 bookwyrm/migrations/0050_auto_20201002_2156.py diff --git a/bookwyrm/migrations/0050_auto_20201002_2156.py b/bookwyrm/migrations/0050_auto_20201002_2156.py new file mode 100644 index 00000000..96cf7ff6 --- /dev/null +++ b/bookwyrm/migrations/0050_auto_20201002_2156.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.7 on 2020-10-02 21:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0049_passwordreset'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='email', + field=models.EmailField(max_length=254, unique=True), + ), + ] diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index ed9735db..529df49d 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -18,6 +18,7 @@ class User(OrderedCollectionPageMixin, AbstractUser): ''' a user who wants to read books ''' private_key = models.TextField(blank=True, null=True) public_key = models.TextField(blank=True, null=True) + email = models.EmailField(unique=True) inbox = models.CharField(max_length=255, unique=True) shared_inbox = models.CharField(max_length=255, blank=True, null=True) federated_server = models.ForeignKey(