Commit 1ccc7dc8 by Diana Huang

Merge pull request #6677 from edx/diana/handle-expired-verification

Show an error when a student needs to reverify due to expiration.
parents 1920ab41 134d2f57
...@@ -299,7 +299,10 @@ class PhotoVerification(StatusModel): ...@@ -299,7 +299,10 @@ class PhotoVerification(StatusModel):
return ('none', error_msg) return ('none', error_msg)
if attempt.created_at < cls._earliest_allowed_date(): 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. # If someone is denied their original verification attempt, they can try to reverify.
# However, if a midcourse reverification is denied, that denial is permanent. # However, if a midcourse reverification is denied, that denial is permanent.
...@@ -742,7 +745,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification): ...@@ -742,7 +745,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
("photoIdReasons", "Text not clear"): _("We couldn't read your name from your photo ID image."), ("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."), ("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", "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: try:
......
...@@ -382,6 +382,14 @@ class TestPhotoVerification(TestCase): ...@@ -382,6 +382,14 @@ class TestPhotoVerification(TestCase):
reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window) reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window)
self.assertEquals(reverify_status, ('denied', '')) 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): def test_display(self):
user = UserFactory.create() user = UserFactory.create()
window = MidcourseReverificationWindowFactory() window = MidcourseReverificationWindowFactory()
......
...@@ -38,23 +38,23 @@ ...@@ -38,23 +38,23 @@
%endif %endif
%if verification_status == 'must_reverify': %if verification_status in ['must_reverify', 'expired']:
<li class="status status-verification is-denied"> <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"> <div class="status-data">
<span class="status-data-message">${verification_msg}</span> <span class="status-data-message">${verification_msg}</span>
<ul class="list-actions"> <ul class="list-actions">
<li class="action-item action-item-reverify"> <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> </li>
</ul> </ul>
<div class="status-note"> <div class="status-note">
<span class="deco-arrow"></span> <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>
</div> </div>
</li> </li>
......
Markdown is supported
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