Skip to content

Commit

Permalink
fix: no need for TOS accept if handler changes status
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Oct 30, 2023
1 parent 25c2c2a commit 1a689da
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
)
from applications.benefit_aggregation import get_former_benefit_info
from applications.enums import (
ApplicationActions,
ApplicationOrigin,
ApplicationStatus,
AttachmentRequirement,
Expand Down Expand Up @@ -1128,8 +1129,14 @@ def _validate_employee_consent(self, instance):

def _update_applicant_terms_approval(self, instance, approve_terms):
if ApplicantTermsApproval.terms_approval_needed(instance):
data = self.context["request"].data
action = data["action"] if "action" in data else None

# Ignore applicant's terms if app origin is from handler
if instance.application_origin == ApplicationOrigin.HANDLER:
if (
instance.application_origin == ApplicationOrigin.HANDLER
or action == ApplicationActions.APPLICANT_TOGGLE_EDIT
):
return

if not approve_terms:
Expand Down

0 comments on commit 1a689da

Please sign in to comment.