stages/*: disable trim_whitespace on important fields

closes #1765

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-10 16:47:56 +01:00
parent 9dd37689e3
commit d5d8641b37
2 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class PasswordChallenge(WithUserInfoChallenge):
class PasswordChallengeResponse(ChallengeResponse):
"""Password challenge response"""
password = CharField()
password = CharField(trim_whitespace=False)
component = CharField(default="ak-stage-password")

View File

@ -85,7 +85,8 @@ class Prompt(SerializerModel):
kwargs = {
"required": self.required,
}
if self.type == FieldTypes.TEXT:
kwargs["trim_whitespace"] = False
if self.type == FieldTypes.TEXT_READ_ONLY:
field_class = ReadOnlyField
if self.type == FieldTypes.EMAIL: