Skip to content

Commit

Permalink
Merge pull request #2284 from coronasafe/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari authored Jul 1, 2024
2 parents 5f8cf93 + 07366d5 commit b506ea0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion care/facility/api/serializers/shifting.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,15 @@ def update(self, instance, validated_data):
if (
"status" in validated_data
and validated_data["status"] == REVERSE_SHIFTING_STATUS_CHOICES["COMPLETED"]
and not has_facility_permission(user, instance.origin_facility)
):
discharge_patient(instance.patient)
raise ValidationError(
{
"status": [
"Permission Denied - Only staff from the origin facility can mark the shift as complete."
]
}
)

old_status = instance.status
new_instance = super().update(instance, validated_data)
Expand Down

0 comments on commit b506ea0

Please sign in to comment.