Skip to content

Commit

Permalink
add a type check in is_privacy_enabled validation
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Oct 28, 2024
1 parent 34070d8 commit efb4763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions care/facility/api/viewsets/bed.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def set_privacy(self, request, external_id):

is_privacy_enabled = request.data.get("is_privacy_enabled")

if is_privacy_enabled is None:
if is_privacy_enabled is None and not isinstance(is_privacy_enabled, bool):
return Response(
{"detail": "'is_privacy_enabled' field is required."},
{"detail": "is_privacy_enabled is required and should be a boolean"},
status=status.HTTP_400_BAD_REQUEST,
)

Expand Down

0 comments on commit efb4763

Please sign in to comment.