We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60ade09 commit 4767a27Copy full SHA for 4767a27
care/facility/api/serializers/bed.py
@@ -227,7 +227,9 @@ def validate(self, attrs):
227
)
228
229
# Conflict checking logic
230
- existing_qs = ConsultationBed.objects.filter(consultation=consultation)
+ existing_qs = ConsultationBed.objects.filter(bed=bed).exclude(
231
+ consultation=consultation
232
+ )
233
if existing_qs.filter(start_date__gt=start_date).exists():
234
raise ValidationError({"start_date": "Cannot create conflicting entry"})
235
if end_date:
0 commit comments