Skip to content
Snippets Groups Projects
Commit 178a8d6c authored by Gijs Hendriksen's avatar Gijs Hendriksen
Browse files

Allow empty values in event registrations API

parent b37c42a4
No related branches found
No related tags found
1 merge request!1353Allow empty values in event registrations API
......@@ -355,12 +355,15 @@ class RegistrationSerializer(serializers.ModelSerializer):
elif field_type == RegistrationInformationField.INTEGER_FIELD:
fields[key] = serializers.IntegerField(
required=field['required'],
write_only=True
write_only=True,
allow_null=not field['required'],
)
elif field_type == RegistrationInformationField.TEXT_FIELD:
fields[key] = serializers.CharField(
required=field['required'],
write_only=True
write_only=True,
allow_blank=not field['required'],
allow_null=not field['required'],
)
fields[key].label = field['label']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment