Skip to content

Commit

Permalink
dont allow users to set consent type as others
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Jun 6, 2024
1 parent 85a9cb1 commit b0db934
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions care/facility/api/serializers/patient_consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,13 @@ class Meta:
"archived_date",
)

def validate_type(self, value):
if value == ConsentType.OTHERS:
raise ValidationError(
"This type is not allowed. Please select a valid Consent Type"
)
return value

def validate(self, attrs):
user = self.context["request"].user
if (
Expand Down

0 comments on commit b0db934

Please sign in to comment.