From 83ac42ac431dbc6f6f47790cb85ba2eb7689343b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 2 Dec 2021 20:32:09 +0100 Subject: [PATCH] stages/prompt: fix error when both default and required are set Signed-off-by: Jens Langhammer --- authentik/stages/prompt/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/authentik/stages/prompt/models.py b/authentik/stages/prompt/models.py index d5ca18bff..bd6381d36 100644 --- a/authentik/stages/prompt/models.py +++ b/authentik/stages/prompt/models.py @@ -113,6 +113,9 @@ class Prompt(SerializerModel): kwargs["label"] = "" if default: kwargs["default"] = default + # May not set both `required` and `default` + if "default" in kwargs: + kwargs.pop("required", None) return field_class(**kwargs) def save(self, *args, **kwargs):