stages/prompt: force required to false when using readonlyfield
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
4c14c7f3a4
commit
ff500b44a6
|
@ -148,6 +148,8 @@ class Prompt(SerializerModel):
|
|||
kwargs["allow_blank"] = not self.required
|
||||
if self.type == FieldTypes.TEXT_READ_ONLY:
|
||||
field_class = ReadOnlyField
|
||||
# required can't be set for ReadOnlyField
|
||||
kwargs["required"] = False
|
||||
if self.type == FieldTypes.EMAIL:
|
||||
field_class = EmailField
|
||||
kwargs["allow_blank"] = not self.required
|
||||
|
|
Reference in New Issue