Allow blank values in certain transaction fields

This commit is contained in:
Keannu Bernasol 2024-01-05 20:44:21 +08:00
parent 004896cb26
commit 7bd33228a6

View file

@ -32,8 +32,12 @@ class TransactionSerializer(serializers.HyperlinkedModelSerializer):
equipments = serializers.SlugRelatedField( equipments = serializers.SlugRelatedField(
many=True, slug_field='id', queryset=EquipmentInstance.objects.all(), required=True) many=True, slug_field='id', queryset=EquipmentInstance.objects.all(), required=True)
subject = serializers.CharField(required=True, allow_null=False) subject = serializers.CharField(required=True, allow_null=False)
additional_members = serializers.CharField(required=False, allow_null=True) additional_members = serializers.CharField(
consumables = serializers.CharField(required=False, allow_null=True) required=False, allow_null=True, allow_blank=True)
remarks = serializers.CharField(
required=False, allow_null=True, allow_blank=True)
consumables = serializers.CharField(
required=False, allow_null=True, allow_blank=True)
timestamp = serializers.DateTimeField( timestamp = serializers.DateTimeField(
format="%m-%d-%Y %I:%M %p", read_only=True) format="%m-%d-%Y %I:%M %p", read_only=True)