Allow user to submit initial verification through reverify flow

ECOM-2933
This commit is contained in:
zubair-arbi
2015-11-20 14:34:38 +05:00
parent 6a76db085f
commit 0b93054cbb
2 changed files with 12 additions and 4 deletions

View File

@@ -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)

View File

@@ -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,