From 465750276ced67507510ba543bfb4cb33d34630e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 14 May 2021 10:49:37 +0200 Subject: [PATCH] core: fix application's slug field not being set to unique closes #881 Signed-off-by: Jens Langhammer --- .../migrations/0021_alter_application_slug.py | 20 +++++++++++++++++++ authentik/core/models.py | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 authentik/core/migrations/0021_alter_application_slug.py diff --git a/authentik/core/migrations/0021_alter_application_slug.py b/authentik/core/migrations/0021_alter_application_slug.py new file mode 100644 index 000000000..7ef52e7d2 --- /dev/null +++ b/authentik/core/migrations/0021_alter_application_slug.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.3 on 2021-05-14 08:48 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("authentik_core", "0020_source_user_matching_mode"), + ] + + operations = [ + migrations.AlterField( + model_name="application", + name="slug", + field=models.SlugField( + help_text="Internal application name, used in URLs.", unique=True + ), + ), + ] diff --git a/authentik/core/models.py b/authentik/core/models.py index 9e0ea3ed5..741f25cfa 100644 --- a/authentik/core/models.py +++ b/authentik/core/models.py @@ -207,7 +207,9 @@ class Application(PolicyBindingModel): add custom fields and other properties""" name = models.TextField(help_text=_("Application's display Name.")) - slug = models.SlugField(help_text=_("Internal application name, used in URLs.")) + slug = models.SlugField( + help_text=_("Internal application name, used in URLs."), unique=True + ) provider = models.OneToOneField( "Provider", null=True, blank=True, default=None, on_delete=models.SET_DEFAULT )