From 0b93054cbbdfe6b9bca150e52138de69c8bab183 Mon Sep 17 00:00:00 2001 From: zubair-arbi Date: Fri, 20 Nov 2015 14:34:38 +0500 Subject: [PATCH] Allow user to submit initial verification through reverify flow ECOM-2933 --- lms/djangoapps/verify_student/tests/test_views.py | 6 ++++++ lms/djangoapps/verify_student/views.py | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index 1638f7c30c..ec0b7c7c34 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -1875,6 +1875,12 @@ class TestReverifyView(TestCase): success = self.client.login(username=self.USERNAME, password=self.PASSWORD) self.assertTrue(success, msg="Could not log in") + def test_reverify_view_can_do_initial_verification(self): + """ + Test that a User can use reverify link for initial verification. + """ + self._assert_can_reverify() + def test_reverify_view_can_reverify_denied(self): # User has a denied attempt, so can reverify attempt = SoftwareSecurePhotoVerification.objects.create(user=self.user) diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index fcd45a52a3..516a52a8e1 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -1358,10 +1358,12 @@ class ReverifyView(View): """ status, _ = SoftwareSecurePhotoVerification.user_status(request.user) - # If the verification process is still ongoing i.e. the status for photo - # verification is either 'submitted' or 'must_retry' then its marked as - # 'pending' - if status in ["must_reverify", "expired", "pending"]: + # If the user has no initial verification or if the verification + # process is still ongoing 'pending' or expired then allow the user to + # submit the photo verification. + # A photo verification is marked as 'pending' if its status is either + # 'submitted' or 'must_retry'. + if status in ["none", "must_reverify", "expired", "pending"]: context = { "user_full_name": request.user.profile.name, "platform_name": settings.PLATFORM_NAME,