Merge pull request #6677 from edx/diana/handle-expired-verification
Show an error when a student needs to reverify due to expiration.
This commit is contained in:
@@ -299,7 +299,10 @@ class PhotoVerification(StatusModel):
|
||||
return ('none', error_msg)
|
||||
|
||||
if attempt.created_at < cls._earliest_allowed_date():
|
||||
return ('expired', error_msg)
|
||||
return (
|
||||
'expired',
|
||||
_("Your {platform_name} verification has expired.").format(platform_name=settings.PLATFORM_NAME)
|
||||
)
|
||||
|
||||
# If someone is denied their original verification attempt, they can try to reverify.
|
||||
# However, if a midcourse reverification is denied, that denial is permanent.
|
||||
@@ -742,7 +745,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
|
||||
("photoIdReasons", "Text not clear"): _("We couldn't read your name from your photo ID image."),
|
||||
("generalReasons", "Name mismatch"): _("The name associated with your account and the name on your ID do not match."),
|
||||
("userPhotoReasons", "Image not clear"): _("The image of your face was not clear."),
|
||||
("userPhotoReasons", "Face out of view"): _("Your face was not visible in your self-photo"),
|
||||
("userPhotoReasons", "Face out of view"): _("Your face was not visible in your self-photo."),
|
||||
}
|
||||
|
||||
try:
|
||||
|
||||
@@ -382,6 +382,14 @@ class TestPhotoVerification(TestCase):
|
||||
reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window)
|
||||
self.assertEquals(reverify_status, ('denied', ''))
|
||||
|
||||
reverify_attempt.status = 'approved'
|
||||
# pylint: disable=protected-access
|
||||
reverify_attempt.created_at = SoftwareSecurePhotoVerification._earliest_allowed_date() + timedelta(days=-1)
|
||||
reverify_attempt.save()
|
||||
reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window)
|
||||
message = 'Your {platform_name} verification has expired.'.format(platform_name=settings.PLATFORM_NAME)
|
||||
self.assertEquals(reverify_status, ('expired', message))
|
||||
|
||||
def test_display(self):
|
||||
user = UserFactory.create()
|
||||
window = MidcourseReverificationWindowFactory()
|
||||
|
||||
@@ -38,23 +38,23 @@
|
||||
|
||||
%endif
|
||||
|
||||
%if verification_status == 'must_reverify':
|
||||
%if verification_status in ['must_reverify', 'expired']:
|
||||
<li class="status status-verification is-denied">
|
||||
<span class="title status-title">${_("ID-Verification Status")}</span>
|
||||
<span class="title status-title">${_("{platform_name} Verification Status").format(platform_name=settings.PLATFORM_NAME)}</span>
|
||||
|
||||
<div class="status-data">
|
||||
<span class="status-data-message">${verification_msg}</span>
|
||||
|
||||
<ul class="list-actions">
|
||||
<li class="action-item action-item-reverify">
|
||||
<a href="${reverse('verify_student_reverify')}" class="action action-reverify">${_("Re-verify Yourself")}</a>
|
||||
<a href="${reverse('verify_student_reverify')}" class="action action-reverify">${_("Resubmit Verification")}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="status-note">
|
||||
<span class="deco-arrow"></span>
|
||||
|
||||
<p>${_("If you fail to pass a verification attempt before your course ends, you will not receive a verified certificate.")}</p>
|
||||
<p>${_("To receive a verified certificate, you have to submit a new photo of yourself and your government-issued photo ID before the course ends.")}</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user