Skip to content

Commit

Permalink
Formatting Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gigincg committed Apr 20, 2022
1 parent eaf66b5 commit f8a2a8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions care/facility/api/serializers/bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ class ConsultationBedSerializer(ModelSerializer):

bed_object = BedSerializer(source="bed", read_only=True)

consultation = ExternalIdSerializerField(
queryset=PatientConsultation.objects.all(), write_only=True, required=True
)
consultation = ExternalIdSerializerField(queryset=PatientConsultation.objects.all(), write_only=True, required=True)
bed = ExternalIdSerializerField(queryset=Bed.objects.all(), write_only=True, required=True)

class Meta:
Expand Down Expand Up @@ -116,7 +114,11 @@ def validate(self, attrs):
raise ValidationError({"end_date": "Cannot create conflicting entry"})

raise ValidationError(
{"consultation": "Field is Required", "bed": "Field is Required", "start_date": "Field is Required"}
{
"consultation": "Field is Required",
"bed": "Field is Required",
"start_date": "Field is Required",
}
)
return super().validate(attrs)

Expand Down

0 comments on commit f8a2a8a

Please sign in to comment.