set allow_null for integerfields, when they are not required

This commit is contained in:
FinnStutzenstein 2019-03-05 14:18:56 +01:00
parent 4349f2eb11
commit 20e2639323
3 changed files with 5 additions and 3 deletions

View File

@ -109,6 +109,7 @@ export class LocalPermissionsService {
motion.state.allow_submitter_edit &&
motion.submitters &&
motion.submitters.length &&
!this.operator.isAnonymous &&
motion.submitters.some(submitter => submitter.id === this.operator.user.id))
);
}
@ -139,6 +140,7 @@ export class LocalPermissionsService {
this.operator.hasPerms('motions.can_manage_metadata') ||
(motion.state &&
motion.state.allow_submitter_edit &&
!this.operator.isAnonymous &&
motion.submitters &&
motion.submitters.some(submitter => submitter.id === this.operator.user.id))
);

View File

@ -68,7 +68,7 @@ class MotionBlockSerializer(ModelSerializer):
"""
agenda_type = IntegerField(
write_only=True, required=False, min_value=1, max_value=3
write_only=True, required=False, min_value=1, max_value=3, allow_null=True
)
agenda_parent_id = IntegerField(write_only=True, required=False, min_value=1)
@ -397,7 +397,7 @@ class MotionSerializer(ModelSerializer):
min_value=1, required=False, validators=[validate_workflow_field]
)
agenda_type = IntegerField(
write_only=True, required=False, min_value=1, max_value=3
write_only=True, required=False, min_value=1, max_value=3, allow_null=True
)
agenda_parent_id = IntegerField(write_only=True, required=False, min_value=1)
submitters = SubmitterSerializer(many=True, read_only=True)

View File

@ -11,7 +11,7 @@ class TopicSerializer(ModelSerializer):
"""
agenda_type = IntegerField(
write_only=True, required=False, min_value=1, max_value=3
write_only=True, required=False, min_value=1, max_value=3, allow_null=True
)
agenda_parent_id = IntegerField(write_only=True, required=False, min_value=1)
agenda_comment = CharField(write_only=True, required=False, allow_blank=True)