Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Review creation for Already Approved Visits. #451

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading