Skip to content
Snippets Groups Projects
Unverified Commit ff515eca authored by Zainab Amir's avatar Zainab Amir Committed by GitHub
Browse files

Add Comments to verify_student/views.py

parents 8eba343a 68a40cd7
Branches
Tags release-2021-03-25-05.28
No related merge requests found
......@@ -1165,6 +1165,11 @@ def results_callback(request):
verification = SoftwareSecurePhotoVerification.objects.filter(status='approved', user_id=attempt.user_id)
if verification:
log.info(u'Making expiry date of previous approved verification NULL for {}'.format(attempt.user_id))
# The updated_at field in sspv model has auto_now set to True, which means any time save() is called on
# the model instance, `updated_at` will change. Some of the existing functionality of verification
# (showing your verification has expired on dashboard) relies on updated_at.
# In case the attempt.approve() fails for some reason and to not cause any inconsistencies in existing
# functionality update() is called instead of save()
previous_verification = verification.latest('updated_at')
SoftwareSecurePhotoVerification.objects.filter(pk=previous_verification.pk
).update(expiry_date=None, expiry_email_date=None)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment