diff --git a/authentik/core/migrations/0027_alter_user_uuid.py b/authentik/core/migrations/0027_alter_user_uuid.py new file mode 100644 index 000000000..11e8c62bd --- /dev/null +++ b/authentik/core/migrations/0027_alter_user_uuid.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.7 on 2023-03-19 21:57 + +import uuid + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("authentik_core", "0026_alter_propertymapping_name_alter_provider_name"), + ] + + operations = [ + migrations.AlterField( + model_name="user", + name="uuid", + field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), + ), + ] diff --git a/authentik/core/models.py b/authentik/core/models.py index ab2434e5b..52b5b637a 100644 --- a/authentik/core/models.py +++ b/authentik/core/models.py @@ -146,7 +146,7 @@ class UserManager(DjangoUserManager): class User(SerializerModel, GuardianUserMixin, AbstractUser): """Custom User model to allow easier adding of user-based settings""" - uuid = models.UUIDField(default=uuid4, editable=False) + uuid = models.UUIDField(default=uuid4, editable=False, unique=True) name = models.TextField(help_text=_("User's display name.")) path = models.TextField(default="users")