Skip to content

Commit

Permalink
revert some serialization checks
Browse files Browse the repository at this point in the history
let's just do a custom endpoint to lock / unlock the application
  • Loading branch information
sirtawast committed Aug 22, 2023
1 parent d104701 commit d510e25
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions backend/benefit/applications/api/v1/serializers/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,26 +1078,6 @@ def _update_applicant_terms_approval(self, instance, approve_terms):
if instance.application_origin == ApplicationOrigin.HANDLER:
return

# Ignore updated applicant's terms if all term consents have been previously accepted
# This is "good enough" (confirmed this from City's benefit team)
if instance.applicant_terms_approval.selected_applicant_consents:
all_consents = sorted(
list(
instance.applicant_terms_approval.selected_applicant_consents.values_list(
"id"
)
)
)
accepted_consents = sorted(
list(
instance.applicant_terms_approval.terms.applicant_consents.values_list(
"id"
)
)
)
if accepted_consents == all_consents:
return

if not approve_terms:
raise serializers.ValidationError(
{"approve_terms": _("Terms must be approved")}
Expand Down

0 comments on commit d510e25

Please sign in to comment.