From 5631a99f00d4711b3a9c0b66e4510c44a123ce68 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 25 Jan 2023 23:29:26 +0100 Subject: [PATCH] stages/prompt: fallback to uuid for unique names Signed-off-by: Jens Langhammer --- authentik/stages/prompt/migrations/0009_prompt_name.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/stages/prompt/migrations/0009_prompt_name.py b/authentik/stages/prompt/migrations/0009_prompt_name.py index 8c11a058c..d6572e81a 100644 --- a/authentik/stages/prompt/migrations/0009_prompt_name.py +++ b/authentik/stages/prompt/migrations/0009_prompt_name.py @@ -1,4 +1,5 @@ # Generated by Django 4.1.5 on 2023-01-23 19:42 +from uuid import uuid4 from django.apps.registry import Apps from django.db import migrations, models @@ -14,6 +15,8 @@ def set_generated_name(apps: Apps, schema_editor: BaseDatabaseSchemaEditor): stage = prompt.promptstage_set.order_by("name").first() if stage: name += "_" + stage.name + else: + name += "_" + uuid4() prompt.name = name prompt.save()