Merge pull request #4551 from normanjaeckel/MotionReasonRequired
Fixed bug that motion reason is required if respective config value i…
This commit is contained in:
commit
ff41aa8061
@ -472,10 +472,9 @@ class MotionSerializer(ModelSerializer):
|
|||||||
else:
|
else:
|
||||||
if "text" in data and not data["text"]:
|
if "text" in data and not data["text"]:
|
||||||
raise ValidationError({"detail": "The text field may not be blank."})
|
raise ValidationError({"detail": "The text field may not be blank."})
|
||||||
if (
|
if config["motions_reason_required"]:
|
||||||
"reason" in data
|
if (self.partial and "reason" in data and not data["reason"]) or (
|
||||||
and not data["reason"]
|
not self.partial and not data.get("reason")
|
||||||
and config["motions_reason_required"]
|
|
||||||
):
|
):
|
||||||
raise ValidationError({"detail": "The reason field may not be blank."})
|
raise ValidationError({"detail": "The reason field may not be blank."})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user