Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion authentik/stages/prompt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def get_initial_value(

return value

def field(self, default: Any | None, choices: list[Any] | None = None) -> CharField:
def field( # noqa PLR0915
self, default: Any | None, choices: list[Any] | None = None
) -> CharField:
"""Get field type for Challenge and response. Choices are only valid for CHOICE_FIELDS."""
field_class = CharField
kwargs = {
Expand All @@ -275,6 +277,7 @@ def field(self, default: Any | None, choices: list[Any] | None = None) -> CharFi
field_class = ReadOnlyField
# required can't be set for ReadOnlyField
kwargs["required"] = False
kwargs["allow_blank"] = True
case FieldTypes.EMAIL:
field_class = EmailField
kwargs["allow_blank"] = not self.required
Expand Down
Loading