Skip to content

Commit

Permalink
Fix dont create review for already approved visits
Browse files Browse the repository at this point in the history
  • Loading branch information
pxwxnvermx committed Dec 9, 2024
1 parent 6172ff7 commit 75e5a8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commcare_connect/opportunity/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,9 @@ def visit_verification(request, org_slug=None, pk=None):
@org_member_required
def approve_visit(request, org_slug=None, pk=None):
user_visit = UserVisit.objects.get(pk=pk)
old_status = user_visit.status
user_visit.status = VisitValidationStatus.approved
if user_visit.opportunity.managed:
if user_visit.opportunity.managed and old_status != VisitValidationStatus.approved:
user_visit.review_created_on = now()
user_visit.save()
opp_id = user_visit.opportunity_id
Expand Down

0 comments on commit 75e5a8c

Please sign in to comment.