diff --git a/common/djangoapps/reverification/admin.py b/common/djangoapps/reverification/admin.py
deleted file mode 100644
index 982572ad73..0000000000
--- a/common/djangoapps/reverification/admin.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""
-Reverification admin
-"""
-
-from ratelimitbackend import admin
-from reverification.models import MidcourseReverificationWindow
-
-admin.site.register(MidcourseReverificationWindow)
diff --git a/common/djangoapps/reverification/models.py b/common/djangoapps/reverification/models.py
index c7a07ee19a..9f98c4f292 100644
--- a/common/djangoapps/reverification/models.py
+++ b/common/djangoapps/reverification/models.py
@@ -10,8 +10,10 @@ from util.validate_on_save import ValidateOnSaveMixin
from xmodule_django.models import CourseKeyField
-class MidcourseReverificationWindow(ValidateOnSaveMixin, models.Model):
+class MidcourseReverificationWindow(ValidateOnSaveMixin, models.Model): # TODO (ECOM-1494): Delete this model.
"""
+ This model has been deprecated and will be removed in a future release.
+
Defines the start and end times for midcourse reverification for a particular course.
There can be many MidcourseReverificationWindows per course, but they cannot have
diff --git a/common/djangoapps/reverification/tests/__init__.py b/common/djangoapps/reverification/tests/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/common/djangoapps/reverification/tests/factories.py b/common/djangoapps/reverification/tests/factories.py
deleted file mode 100644
index 4416875243..0000000000
--- a/common/djangoapps/reverification/tests/factories.py
+++ /dev/null
@@ -1,20 +0,0 @@
-"""
-verify_student factories
-"""
-from reverification.models import MidcourseReverificationWindow
-from factory.django import DjangoModelFactory
-import pytz
-from datetime import timedelta, datetime
-from opaque_keys.edx.locations import SlashSeparatedCourseKey
-
-
-# Factories are self documenting
-# pylint: disable=missing-docstring
-class MidcourseReverificationWindowFactory(DjangoModelFactory):
- """ Creates a generic MidcourseReverificationWindow. """
- FACTORY_FOR = MidcourseReverificationWindow
-
- course_id = SlashSeparatedCourseKey.from_deprecated_string(u'MITx/999/Robot_Super_Course')
- # By default this factory creates a window that is currently open
- start_date = datetime.now(pytz.UTC) - timedelta(days=100)
- end_date = datetime.now(pytz.UTC) + timedelta(days=100)
diff --git a/common/djangoapps/reverification/tests/test_models.py b/common/djangoapps/reverification/tests/test_models.py
deleted file mode 100644
index 0fc7d63427..0000000000
--- a/common/djangoapps/reverification/tests/test_models.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""
-Tests for Reverification models
-"""
-from datetime import timedelta, datetime
-import pytz
-
-from django.core.exceptions import ValidationError
-
-from reverification.models import MidcourseReverificationWindow
-from reverification.tests.factories import MidcourseReverificationWindowFactory
-from xmodule.modulestore.tests.factories import CourseFactory
-from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
-
-
-class TestMidcourseReverificationWindow(ModuleStoreTestCase):
- """ Tests for MidcourseReverificationWindow objects """
-
- def setUp(self, **kwargs):
- super(TestMidcourseReverificationWindow, self).setUp()
- self.course_id = CourseFactory.create().id
-
- def test_window_open_for_course(self):
- # Should return False if no windows exist for a course
- self.assertFalse(MidcourseReverificationWindow.window_open_for_course(self.course_id))
-
- # Should return False if a window exists, but it's not in the current timeframe
- MidcourseReverificationWindowFactory(
- course_id=self.course_id,
- start_date=datetime.now(pytz.utc) - timedelta(days=10),
- end_date=datetime.now(pytz.utc) - timedelta(days=5)
- )
- self.assertFalse(MidcourseReverificationWindow.window_open_for_course(self.course_id))
-
- # Should return True if a non-expired window exists
- MidcourseReverificationWindowFactory(
- course_id=self.course_id,
- start_date=datetime.now(pytz.utc) - timedelta(days=3),
- end_date=datetime.now(pytz.utc) + timedelta(days=3)
- )
- self.assertTrue(MidcourseReverificationWindow.window_open_for_course(self.course_id))
-
- def test_get_window(self):
- # if no window exists, returns None
- self.assertIsNone(MidcourseReverificationWindow.get_window(self.course_id, datetime.now(pytz.utc)))
-
- # we should get the expected window otherwise
- window_valid = MidcourseReverificationWindowFactory(
- course_id=self.course_id,
- start_date=datetime.now(pytz.utc) - timedelta(days=3),
- end_date=datetime.now(pytz.utc) + timedelta(days=3)
- )
- self.assertEquals(
- window_valid,
- MidcourseReverificationWindow.get_window(self.course_id, datetime.now(pytz.utc))
- )
-
- def test_no_overlapping_windows(self):
- window_valid = MidcourseReverificationWindow(
- course_id=self.course_id,
- start_date=datetime.now(pytz.utc) - timedelta(days=3),
- end_date=datetime.now(pytz.utc) + timedelta(days=3)
- )
- window_valid.save()
-
- with self.assertRaises(ValidationError):
- window_invalid = MidcourseReverificationWindow(
- course_id=self.course_id,
- start_date=datetime.now(pytz.utc) - timedelta(days=2),
- end_date=datetime.now(pytz.utc) + timedelta(days=4)
- )
- window_invalid.save()
diff --git a/common/djangoapps/student/tests/test_verification_status.py b/common/djangoapps/student/tests/test_verification_status.py
index 75c0aaf9da..222a33bd22 100644
--- a/common/djangoapps/student/tests/test_verification_status.py
+++ b/common/djangoapps/student/tests/test_verification_status.py
@@ -7,7 +7,6 @@ from mock import patch
from pytz import UTC
from django.core.urlresolvers import reverse
from django.conf import settings
-from reverification.tests.factories import MidcourseReverificationWindowFactory
from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY,
@@ -260,13 +259,11 @@ class TestCourseVerificationStatus(UrlResetMixin, ModuleStoreTestCase):
mode="verified"
)
- window = MidcourseReverificationWindowFactory(course_id=course2.id)
# The student has an approved verification
attempt2 = SoftwareSecurePhotoVerification.objects.create(user=self.user)
attempt2.mark_ready()
attempt2.submit()
attempt2.approve()
- attempt2.window = window
attempt2.save()
# Mark the attemp2 as approved so its date will appear on dasboard.
diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py
index 5f110b577d..2569f30d65 100644
--- a/common/djangoapps/student/views.py
+++ b/common/djangoapps/student/views.py
@@ -217,10 +217,6 @@ def reverification_info(course_enrollment_pairs, user, statuses):
dict["must_reverify"] = [some information]
"""
reverifications = defaultdict(list)
- for (course, enrollment) in course_enrollment_pairs:
- info = single_course_reverification_info(user, course, enrollment)
- if info:
- reverifications[info.status].append(info)
# Sort the data by the reverification_end_date
for status in statuses:
@@ -229,34 +225,6 @@ def reverification_info(course_enrollment_pairs, user, statuses):
return reverifications
-def single_course_reverification_info(user, course, enrollment): # pylint: disable=invalid-name
- """Returns midcourse reverification-related information for user with enrollment in course.
-
- If a course has an open re-verification window, and that user has a verified enrollment in
- the course, we return a tuple with relevant information. Returns None if there is no info..
-
- Args:
- user (User): the user we want to get information for
- course (Course): the course in which the student is enrolled
- enrollment (CourseEnrollment): the object representing the type of enrollment user has in course
-
- Returns:
- ReverifyInfo: (course_id, course_name, course_number, date, status)
- OR, None: None if there is no re-verification info for this enrollment
- """
- window = MidcourseReverificationWindow.get_window(course.id, datetime.datetime.now(UTC))
-
- # If there's no window OR the user is not verified, we don't get reverification info
- if (not window) or (enrollment.mode != "verified"):
- return None
- return ReverifyInfo(
- course.id, course.display_name, course.number,
- window.end_date.strftime('%B %d, %Y %X %p'),
- SoftwareSecurePhotoVerification.user_status(user, window)[0],
- SoftwareSecurePhotoVerification.display_status(user, window),
- )
-
-
def get_course_enrollment_pairs(user, course_org_filter, org_filter_out_set):
"""
Get the relevant set of (Course, CourseEnrollment) pairs to be displayed on
diff --git a/lms/djangoapps/certificates/queue.py b/lms/djangoapps/certificates/queue.py
index a560d83640..7926b23fdb 100644
--- a/lms/djangoapps/certificates/queue.py
+++ b/lms/djangoapps/certificates/queue.py
@@ -245,11 +245,10 @@ class XQueueCertInterface(object):
enrollment_mode, __ = CourseEnrollment.enrollment_mode_for_user(student, course_id)
mode_is_verified = (enrollment_mode == GeneratedCertificate.MODES.verified)
user_is_verified = SoftwareSecurePhotoVerification.user_is_verified(student)
- user_is_reverified = SoftwareSecurePhotoVerification.user_is_reverified_for_all(course_id, student)
cert_mode = enrollment_mode
- if (mode_is_verified and user_is_verified and user_is_reverified):
+ if mode_is_verified and user_is_verified:
template_pdf = "certificate-template-{id.org}-{id.course}-verified.pdf".format(id=course_id)
- elif (mode_is_verified and not (user_is_verified and user_is_reverified)):
+ elif mode_is_verified and not user_is_verified:
template_pdf = "certificate-template-{id.org}-{id.course}.pdf".format(id=course_id)
cert_mode = GeneratedCertificate.MODES.honor
else:
diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py
index 71e5796631..4c0d93b7a2 100644
--- a/lms/djangoapps/courseware/views.py
+++ b/lms/djangoapps/courseware/views.py
@@ -8,7 +8,6 @@ import json
import cgi
from datetime import datetime
-from collections import defaultdict
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
@@ -51,11 +50,9 @@ from .entrance_exams import (
from courseware.models import StudentModule, StudentModuleHistory
from course_modes.models import CourseMode
-from lms.djangoapps.lms_xblock.models import XBlockAsidesConfig
-
from open_ended_grading import open_ended_notifications
from student.models import UserTestGroup, CourseEnrollment
-from student.views import single_course_reverification_info, is_course_blocked
+from student.views import is_course_blocked
from util.cache import cache, cache_if_anonymous
from xblock.fragment import Fragment
from xmodule.modulestore.django import modulestore
@@ -422,7 +419,6 @@ def _index_bulk_op(request, course_key, chapter, section, position):
'studio_url': studio_url,
'masquerade': masquerade,
'xqa_server': settings.FEATURES.get('XQA_SERVER', "http://your_xqa_server.com"),
- 'reverifications': fetch_reverify_banner_info(request, course_key),
}
now = datetime.now(UTC())
@@ -676,7 +672,6 @@ def course_info(request, course_id):
staff_access = has_access(request.user, 'staff', course)
masquerade = setup_masquerade(request, course_key, staff_access) # allow staff to masquerade on the info page
- reverifications = fetch_reverify_banner_info(request, course_key)
studio_url = get_studio_url(course, 'course_info')
# link to where the student should go to enroll in the course:
@@ -695,7 +690,6 @@ def course_info(request, course_id):
'staff_access': staff_access,
'masquerade': masquerade,
'studio_url': studio_url,
- 'reverifications': reverifications,
'show_enroll_banner': show_enroll_banner,
'url_to_enroll': url_to_enroll,
}
@@ -1058,7 +1052,6 @@ def _progress(request, course_key, student_id):
'grade_summary': grade_summary,
'staff_access': staff_access,
'student': student,
- 'reverifications': fetch_reverify_banner_info(request, course_key),
'passed': is_course_passed(course, grade_summary),
'show_generate_cert_btn': show_generate_cert_btn
}
@@ -1072,23 +1065,6 @@ def _progress(request, course_key, student_id):
return response
-def fetch_reverify_banner_info(request, course_key):
- """
- Fetches needed context variable to display reverification banner in courseware
- """
- reverifications = defaultdict(list)
- user = request.user
- if not user.id:
- return reverifications
- enrollment = CourseEnrollment.get_enrollment(request.user, course_key)
- if enrollment is not None:
- course = modulestore().get_course(course_key)
- info = single_course_reverification_info(user, course, enrollment)
- if info:
- reverifications[info.status].append(info)
- return reverifications
-
-
@login_required
@ensure_valid_course_key
def submission_history(request, course_id, student_username, location):
diff --git a/lms/djangoapps/verify_student/admin.py b/lms/djangoapps/verify_student/admin.py
index a9a26d3bdf..0d93b202a7 100644
--- a/lms/djangoapps/verify_student/admin.py
+++ b/lms/djangoapps/verify_student/admin.py
@@ -13,6 +13,7 @@ class SoftwareSecurePhotoVerificationAdmin(admin.ModelAdmin):
Admin for the SoftwareSecurePhotoVerification table.
"""
list_display = ('id', 'user', 'status', 'receipt_id', 'submitted_at', 'updated_at')
+ exclude = ('window',) # TODO: Remove after deleting this field from the model.
search_fields = (
'receipt_id',
)
diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py
index e9a7f5a1c1..2c5e376845 100644
--- a/lms/djangoapps/verify_student/models.py
+++ b/lms/djangoapps/verify_student/models.py
@@ -154,6 +154,7 @@ class PhotoVerification(StatusModel):
# Indicates whether or not a user wants to see the verification status
# displayed on their dash. Right now, only relevant for allowing students
# to "dismiss" a failed midcourse reverification message
+ # TODO: This field is deprecated.
display = models.BooleanField(db_index=True, default=True)
######################## Fields Set When Submitting ########################
@@ -196,26 +197,23 @@ class PhotoVerification(StatusModel):
return datetime.now(pytz.UTC) - timedelta(days=days_good_for)
@classmethod
- def user_is_verified(cls, user, earliest_allowed_date=None, window=None):
+ def user_is_verified(cls, user, earliest_allowed_date=None):
"""
Return whether or not a user has satisfactorily proved their identity.
Depending on the policy, this can expire after some period of time, so
a user might have to renew periodically.
- If window=None, then this will check for the user's *initial* verification.
- If window is set to anything else, it will check for the reverification
- associated with that window.
+ This will check for the user's *initial* verification.
"""
return cls.objects.filter(
user=user,
status="approved",
created_at__gte=(earliest_allowed_date
- or cls._earliest_allowed_date()),
- window=window
+ or cls._earliest_allowed_date())
).exists()
@classmethod
- def verification_valid_or_pending(cls, user, earliest_allowed_date=None, window=None, queryset=None):
+ def verification_valid_or_pending(cls, user, earliest_allowed_date=None, queryset=None):
"""
Check whether the user has a complete verification attempt that is
or *might* be good. This means that it's approved, been submitted,
@@ -223,15 +221,12 @@ class PhotoVerification(StatusModel):
being submitted.
It's basically any situation in which the user has signed off on
the contents of the attempt, and we have not yet received a denial.
+ This will check for the user's *initial* verification.
Arguments:
user:
earliest_allowed_date: earliest allowed date given in the
settings
- window: If window=None, this will check for the user's
- *initial* verification.
- If window is anything else, this will check for the
- reverification associated with that window.
queryset: If a queryset is provided, that will be used instead
of hitting the database.
@@ -239,9 +234,9 @@ class PhotoVerification(StatusModel):
queryset: queryset of 'PhotoVerification' sorted by 'created_at' in
descending order.
"""
- valid_statuses = ['submitted', 'approved']
- if not window:
- valid_statuses.append('must_retry')
+
+ valid_statuses = ['submitted', 'approved', 'must_retry']
+
if queryset is None:
queryset = cls.objects.filter(user=user)
@@ -250,39 +245,37 @@ class PhotoVerification(StatusModel):
created_at__gte=(
earliest_allowed_date
or cls._earliest_allowed_date()
- ),
- window=window,
+ )
).order_by('-created_at')
@classmethod
- def user_has_valid_or_pending(cls, user, earliest_allowed_date=None, window=None, queryset=None):
+ def user_has_valid_or_pending(cls, user, earliest_allowed_date=None, queryset=None):
"""
Check whether the user has an active or pending verification attempt
Returns:
bool: True or False according to existence of valid verifications
"""
- return cls.verification_valid_or_pending(user, earliest_allowed_date, window, queryset).exists()
+ return cls.verification_valid_or_pending(user, earliest_allowed_date, queryset).exists()
@classmethod
- def active_for_user(cls, user, window=None):
+ def active_for_user(cls, user):
"""
Return the most recent PhotoVerification that is marked ready (i.e. the
user has said they're set, but we haven't submitted anything yet).
- If window=None, this checks for the original verification. If window is set to
- anything else, this will check for the reverification associated with that window.
+ This checks for the original verification.
"""
# This should only be one at the most, but just in case we create more
# by mistake, we'll grab the most recently created one.
- active_attempts = cls.objects.filter(user=user, status='ready', window=window).order_by('-created_at')
+ active_attempts = cls.objects.filter(user=user, status='ready').order_by('-created_at')
if active_attempts:
return active_attempts[0]
else:
return None
@classmethod
- def user_status(cls, user, window=None):
+ def user_status(cls, user):
"""
Returns the status of the user based on their past verification attempts
@@ -292,16 +285,15 @@ class PhotoVerification(StatusModel):
If the verification process is still ongoing, returns 'pending'
If the verification has been denied and the user must resubmit photos, returns 'must_reverify'
- If window=None, this checks initial verifications
- If window is set, this checks for the reverification associated with that window
+ This checks initial verifications
"""
status = 'none'
error_msg = ''
- if cls.user_is_verified(user, window=window):
+ if cls.user_is_verified(user):
status = 'approved'
- elif cls.user_has_valid_or_pending(user, window=window):
+ elif cls.user_has_valid_or_pending(user):
# user_has_valid_or_pending does include 'approved', but if we are
# here, we know that the attempt is still pending
status = 'pending'
@@ -310,17 +302,12 @@ class PhotoVerification(StatusModel):
# we need to check the most recent attempt to see if we need to ask them to do
# a retry
try:
- attempts = cls.objects.filter(user=user, window=window).order_by('-updated_at')
+ attempts = cls.objects.filter(user=user).order_by('-updated_at')
attempt = attempts[0]
except IndexError:
-
- # If no verification exists for a *midcourse* reverification, then that just
- # means the student still needs to reverify. For *original* verifications,
# we return 'none'
- if(window):
- return('must_reverify', error_msg)
- else:
- return ('none', error_msg)
+
+ return ('none', error_msg)
if attempt.created_at < cls._earliest_allowed_date():
return (
@@ -329,12 +316,9 @@ class PhotoVerification(StatusModel):
)
# If someone is denied their original verification attempt, they can try to reverify.
- # However, if a midcourse reverification is denied, that denial is permanent.
if attempt.status == 'denied':
- if window is None:
- status = 'must_reverify'
- else:
- status = 'denied'
+ status = 'must_reverify'
+
if attempt.error_msg:
error_msg = attempt.parsed_error_msg()
@@ -562,28 +546,6 @@ class PhotoVerification(StatusModel):
self.status = "must_retry"
self.save()
- @classmethod
- def display_off(cls, user_id):
- """
- Find all failed PhotoVerifications for a user, and sets those verifications' `display`
- property to false, so the notification banner can be switched off.
- """
- user = User.objects.get(id=user_id)
- cls.objects.filter(user=user, status="denied").exclude(window=None).update(display=False)
-
- @classmethod
- def display_status(cls, user, window):
- """
- Finds the `display` property for the PhotoVerification associated with
- (user, window). Default is True
- """
- attempts = cls.objects.filter(user=user, window=window).order_by('-updated_at')
- try:
- attempt = attempts[0]
- return attempt.display
- except IndexError:
- return True
-
class SoftwareSecurePhotoVerification(PhotoVerification):
"""
@@ -624,44 +586,15 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
IMAGE_LINK_DURATION = 5 * 60 * 60 * 24 # 5 days in seconds
- window = models.ForeignKey(MidcourseReverificationWindow, db_index=True, null=True)
-
- @classmethod
- def user_is_reverified_for_all(cls, course_id, user):
- """
- Checks to see if the student has successfully reverified for all of the
- mandatory re-verification windows associated with a course.
-
- This is used primarily by the certificate generation code... if the user is
- not re-verified for all windows, then they cannot receive a certificate.
- """
- all_windows = MidcourseReverificationWindow.objects.filter(course_id=course_id)
- # if there are no windows for a course, then return True right off
- if (not all_windows.exists()):
- return True
-
- for window in all_windows:
- try:
- # The status of the most recent reverification for each window must be "approved"
- # for a student to count as completely reverified
- attempts = cls.objects.filter(user=user, window=window).order_by('-updated_at')
- attempt = attempts[0]
- if attempt.status != "approved":
- return False
- except Exception: # pylint: disable=broad-except
- log.exception(
- u"An error occurred while checking re-verification for user '{user_id}'".format(user_id=user)
- )
- return False
-
- return True
+ # This field has been deprecated and will be removed in a future release.
+ window = models.ForeignKey(MidcourseReverificationWindow, db_index=True, null=True) # TODO(ECOM-1494):Remove this.
@classmethod
def original_verification(cls, user):
"""
Returns the most current SoftwareSecurePhotoVerification object associated with the user.
"""
- query = cls.objects.filter(user=user, window=None).order_by('-updated_at')
+ query = cls.objects.filter(user=user).order_by('-updated_at')
return query[0]
@classmethod
@@ -672,7 +605,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
Return:
SoftwareSecurePhotoVerification (object)
"""
- init_verification = cls.objects.filter(user=user, status__in=["submitted", "approved"], window=None)
+ init_verification = cls.objects.filter(user=user, status__in=["submitted", "approved"])
return init_verification.latest('created_at') if init_verification.exists() else None
@status_before_must_be("created")
@@ -950,11 +883,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
if not user_is_verified:
return 'Not ID Verified'
else:
- user_is_re_verified = cls.user_is_reverified_for_all(course_id, user)
- if not user_is_re_verified:
- return 'ID Verification Expired'
- else:
- return 'ID Verified'
+ return 'ID Verified'
class VerificationCheckpoint(models.Model):
diff --git a/lms/djangoapps/verify_student/tests/test_models.py b/lms/djangoapps/verify_student/tests/test_models.py
index 3788c3b3f5..987a0edadb 100644
--- a/lms/djangoapps/verify_student/tests/test_models.py
+++ b/lms/djangoapps/verify_student/tests/test_models.py
@@ -12,7 +12,6 @@ from mock import patch
from nose.tools import assert_is_none, assert_equals, assert_raises, assert_true, assert_false # pylint: disable=E0611
from opaque_keys.edx.locations import SlashSeparatedCourseKey
-from reverification.tests.factories import MidcourseReverificationWindowFactory
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@@ -220,17 +219,12 @@ class TestPhotoVerification(ModuleStoreTestCase):
def test_fetch_photo_id_image(self):
user = UserFactory.create()
- orig_attempt = SoftwareSecurePhotoVerification(user=user, window=None)
+ orig_attempt = SoftwareSecurePhotoVerification(user=user)
orig_attempt.save()
old_key = orig_attempt.photo_id_key
- window = MidcourseReverificationWindowFactory(
- course_id=SlashSeparatedCourseKey("pony", "rainbow", "dash"),
- start_date=datetime.now(pytz.utc) - timedelta(days=5),
- end_date=datetime.now(pytz.utc) + timedelta(days=5)
- )
- new_attempt = SoftwareSecurePhotoVerification(user=user, window=window)
+ new_attempt = SoftwareSecurePhotoVerification(user=user)
new_attempt.save()
new_attempt.fetch_photo_id_image()
assert_equals(new_attempt.photo_id_key, old_key)
@@ -366,45 +360,6 @@ class TestPhotoVerification(ModuleStoreTestCase):
status = SoftwareSecurePhotoVerification.user_status(user)
self.assertEquals(status, ('must_reverify', "No photo ID was provided."))
- # test for correct status for reverifications
- window = MidcourseReverificationWindowFactory()
- reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window)
- self.assertEquals(reverify_status, ('must_reverify', ''))
-
- reverify_attempt = SoftwareSecurePhotoVerification(user=user, window=window)
- reverify_attempt.status = 'approved'
- reverify_attempt.save()
-
- reverify_status = SoftwareSecurePhotoVerification.user_status(user=user, window=window)
- self.assertEquals(reverify_status, ('approved', ''))
-
- reverify_attempt.status = 'denied'
- reverify_attempt.save()
-
- 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()
- attempt = SoftwareSecurePhotoVerification(user=user, window=window, status="denied")
- attempt.save()
-
- # We expect the verification to be displayed by default
- self.assertEquals(SoftwareSecurePhotoVerification.display_status(user, window), True)
-
- # Turn it off
- SoftwareSecurePhotoVerification.display_off(user.id)
- self.assertEquals(SoftwareSecurePhotoVerification.display_status(user, window), False)
-
def test_parse_error_msg_success(self):
user = UserFactory.create()
attempt = SoftwareSecurePhotoVerification(user=user)
@@ -508,10 +463,9 @@ class TestPhotoVerification(ModuleStoreTestCase):
@ddt.unpack
@ddt.data(
- {'enrollment_mode': 'honor', 'status': (None, None), 'output': 'N/A'},
- {'enrollment_mode': 'verified', 'status': (False, False), 'output': 'Not ID Verified'},
- {'enrollment_mode': 'verified', 'status': (True, True), 'output': 'ID Verified'},
- {'enrollment_mode': 'verified', 'status': (True, False), 'output': 'ID Verification Expired'}
+ {'enrollment_mode': 'honor', 'status': None, 'output': 'N/A'},
+ {'enrollment_mode': 'verified', 'status': False, 'output': 'Not ID Verified'},
+ {'enrollment_mode': 'verified', 'status': True, 'output': 'ID Verified'},
)
def test_verification_status_for_user(self, enrollment_mode, status, output):
"""
@@ -520,112 +474,12 @@ class TestPhotoVerification(ModuleStoreTestCase):
user = UserFactory.create()
course = CourseFactory.create()
- user_reverified_path = 'verify_student.models.SoftwareSecurePhotoVerification.user_is_reverified_for_all'
with patch('verify_student.models.SoftwareSecurePhotoVerification.user_is_verified') as mock_verification:
- with patch(user_reverified_path) as mock_re_verification:
- mock_verification.return_value = status[0]
- mock_re_verification.return_value = status[1]
- status = SoftwareSecurePhotoVerification.verification_status_for_user(user, course.id, enrollment_mode)
- self.assertEqual(status, output)
+ mock_verification.return_value = status
-
-@patch.dict(settings.VERIFY_STUDENT, FAKE_SETTINGS)
-@patch('verify_student.models.S3Connection', new=MockS3Connection)
-@patch('verify_student.models.Key', new=MockKey)
-@patch('verify_student.models.requests.post', new=mock_software_secure_post)
-class TestMidcourseReverification(ModuleStoreTestCase):
- """ Tests for methods that are specific to midcourse SoftwareSecurePhotoVerification objects """
-
- def setUp(self):
- super(TestMidcourseReverification, self).setUp()
- self.course = CourseFactory.create()
- self.user = UserFactory.create()
-
- def test_user_is_reverified_for_all(self):
-
- # if there are no windows for a course, this should return True
- self.assertTrue(SoftwareSecurePhotoVerification.user_is_reverified_for_all(self.course.id, self.user))
-
- # first, make three windows
- window1 = MidcourseReverificationWindowFactory(
- course_id=self.course.id,
- start_date=datetime.now(pytz.UTC) - timedelta(days=15),
- end_date=datetime.now(pytz.UTC) - timedelta(days=13),
- )
-
- window2 = MidcourseReverificationWindowFactory(
- course_id=self.course.id,
- start_date=datetime.now(pytz.UTC) - timedelta(days=10),
- end_date=datetime.now(pytz.UTC) - timedelta(days=8),
- )
-
- window3 = MidcourseReverificationWindowFactory(
- course_id=self.course.id,
- start_date=datetime.now(pytz.UTC) - timedelta(days=5),
- end_date=datetime.now(pytz.UTC) - timedelta(days=3),
- )
-
- # make two SSPMidcourseReverifications for those windows
- attempt1 = SoftwareSecurePhotoVerification(
- status="approved",
- user=self.user,
- window=window1
- )
- attempt1.save()
-
- attempt2 = SoftwareSecurePhotoVerification(
- status="approved",
- user=self.user,
- window=window2
- )
- attempt2.save()
-
- # should return False because only 2 of 3 windows have verifications
- self.assertFalse(SoftwareSecurePhotoVerification.user_is_reverified_for_all(self.course.id, self.user))
-
- attempt3 = SoftwareSecurePhotoVerification(
- status="must_retry",
- user=self.user,
- window=window3
- )
- attempt3.save()
-
- # should return False because the last verification exists BUT is not approved
- self.assertFalse(SoftwareSecurePhotoVerification.user_is_reverified_for_all(self.course.id, self.user))
-
- attempt3.status = "approved"
- attempt3.save()
-
- # should now return True because all windows have approved verifications
- self.assertTrue(SoftwareSecurePhotoVerification.user_is_reverified_for_all(self.course.id, self.user))
-
- def test_original_verification(self):
- orig_attempt = SoftwareSecurePhotoVerification(user=self.user)
- orig_attempt.save()
- window = MidcourseReverificationWindowFactory(
- course_id=self.course.id,
- start_date=datetime.now(pytz.UTC) - timedelta(days=15),
- end_date=datetime.now(pytz.UTC) - timedelta(days=13),
- )
- midcourse_attempt = SoftwareSecurePhotoVerification(user=self.user, window=window)
- self.assertEquals(midcourse_attempt.original_verification(user=self.user), orig_attempt)
-
- def test_user_has_valid_or_pending(self):
- window = MidcourseReverificationWindowFactory(
- course_id=self.course.id,
- start_date=datetime.now(pytz.UTC) - timedelta(days=15),
- end_date=datetime.now(pytz.UTC) - timedelta(days=13),
- )
-
- attempt = SoftwareSecurePhotoVerification(status="must_retry", user=self.user, window=window)
- attempt.save()
-
- assert_false(SoftwareSecurePhotoVerification.user_has_valid_or_pending(user=self.user, window=window))
-
- attempt.status = "approved"
- attempt.save()
- assert_true(SoftwareSecurePhotoVerification.user_has_valid_or_pending(user=self.user, window=window))
+ status = SoftwareSecurePhotoVerification.verification_status_for_user(user, course.id, enrollment_mode)
+ self.assertEqual(status, output)
@ddt.ddt
diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py
index 0c8cf2baa4..2627c40795 100644
--- a/lms/djangoapps/verify_student/tests/test_views.py
+++ b/lms/djangoapps/verify_student/tests/test_views.py
@@ -48,7 +48,6 @@ from verify_student.models import (
SoftwareSecurePhotoVerification, VerificationCheckpoint,
InCourseReverificationConfiguration, VerificationStatus
)
-from reverification.tests.factories import MidcourseReverificationWindowFactory
from util.date_utils import get_default_time_display
@@ -1507,32 +1506,6 @@ class TestPhotoVerificationResultsCallback(ModuleStoreTestCase):
)
self.assertIn('Result Unknown not understood', response.content)
- @mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature))
- def test_reverification(self):
- """
- Test software secure result for reverification window.
- """
- data = {
- "EdX-ID": self.receipt_id,
- "Result": "PASS",
- "Reason": "",
- "MessageType": "You have been verified."
- }
- window = MidcourseReverificationWindowFactory(course_id=self.course_id)
- self.attempt.window = window
- self.attempt.save()
- json_data = json.dumps(data)
- self.assertEqual(CourseEnrollment.objects.filter(course_id=self.course_id).count(), 0)
- response = self.client.post(
- reverse('verify_student_results_callback'),
- data=json_data,
- content_type='application/json',
- HTTP_AUTHORIZATION='test BBBBBBBBBBBBBBBBBBBB:testing',
- HTTP_DATE='testdate'
- )
- self.assertEquals(response.content, 'OK!')
- self.assertIsNotNone(CourseEnrollment.objects.get(course_id=self.course_id))
-
@mock.patch('verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature))
def test_in_course_reverify_disabled(self):
"""
@@ -1697,154 +1670,6 @@ class TestReverifyView(ModuleStoreTestCase):
self.assertTrue(context['error'])
-class TestMidCourseReverifyView(ModuleStoreTestCase):
- """
- Tests for the midcourse reverification views.
- """
- def setUp(self):
- super(TestMidCourseReverifyView, self).setUp()
-
- self.user = UserFactory.create(username="rusty", password="test")
- self.client.login(username="rusty", password="test")
- self.course_key = SlashSeparatedCourseKey("Robot", "999", "Test_Course")
- CourseFactory.create(org='Robot', number='999', display_name='Test Course')
-
- patcher = patch('student.models.tracker')
- self.mock_tracker = patcher.start()
- self.addCleanup(patcher.stop)
-
- @patch('verify_student.views.render_to_response', render_mock)
- def test_midcourse_reverify_get(self):
- url = reverse('verify_student_midcourse_reverify',
- kwargs={"course_id": self.course_key.to_deprecated_string()})
- response = self.client.get(url)
-
- self.mock_tracker.emit.assert_any_call( # pylint: disable=maybe-no-member
- 'edx.course.enrollment.mode_changed',
- {
- 'user_id': self.user.id,
- 'course_id': self.course_key.to_deprecated_string(),
- 'mode': "verified",
- }
- )
-
- # Check that user entering the reverify flow was logged, and that it was the last call
- self.mock_tracker.emit.assert_called_with( # pylint: disable=maybe-no-member
- 'edx.course.enrollment.reverify.started',
- {
- 'user_id': self.user.id,
- 'course_id': self.course_key.to_deprecated_string(),
- 'mode': "verified",
- }
- )
-
- self.assertTrue(self.mock_tracker.emit.call_count, 2) # pylint: disable=no-member
-
- self.mock_tracker.emit.reset_mock() # pylint: disable=no-member
-
- self.assertEquals(response.status_code, 200)
- ((_template, context), _kwargs) = render_mock.call_args # pylint: disable=unpacking-non-sequence
- self.assertFalse(context['error'])
-
- @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True})
- def test_midcourse_reverify_post_success(self):
- window = MidcourseReverificationWindowFactory(course_id=self.course_key)
- url = reverse('verify_student_midcourse_reverify', kwargs={'course_id': self.course_key.to_deprecated_string()})
-
- response = self.client.post(url, {'face_image': ','})
-
- self.mock_tracker.emit.assert_any_call( # pylint: disable=maybe-no-member
- 'edx.course.enrollment.mode_changed',
- {
- 'user_id': self.user.id,
- 'course_id': self.course_key.to_deprecated_string(),
- 'mode': "verified",
- }
- )
-
- # Check that submission event was logged, and that it was the last call
- self.mock_tracker.emit.assert_called_with( # pylint: disable=maybe-no-member
- 'edx.course.enrollment.reverify.submitted',
- {
- 'user_id': self.user.id,
- 'course_id': self.course_key.to_deprecated_string(),
- 'mode': "verified",
- }
- )
-
- self.assertTrue(self.mock_tracker.emit.call_count, 2) # pylint: disable=no-member
-
- self.mock_tracker.emit.reset_mock() # pylint: disable=no-member
-
- self.assertEquals(response.status_code, 302)
- try:
- verification_attempt = SoftwareSecurePhotoVerification.objects.get(user=self.user, window=window)
- self.assertIsNotNone(verification_attempt)
- except ObjectDoesNotExist:
- self.fail('No verification object generated')
-
- @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True})
- def test_midcourse_reverify_post_failure_expired_window(self):
- window = MidcourseReverificationWindowFactory(
- course_id=self.course_key,
- start_date=datetime.now(pytz.UTC) - timedelta(days=100),
- end_date=datetime.now(pytz.UTC) - timedelta(days=50),
- )
- url = reverse('verify_student_midcourse_reverify', kwargs={'course_id': self.course_key.to_deprecated_string()})
- response = self.client.post(url, {'face_image': ','})
- self.assertEquals(response.status_code, 302)
- with self.assertRaises(ObjectDoesNotExist):
- SoftwareSecurePhotoVerification.objects.get(user=self.user, window=window)
-
- @patch('verify_student.views.render_to_response', render_mock)
- def test_midcourse_reverify_dash(self):
- url = reverse('verify_student_midcourse_reverify_dash')
- response = self.client.get(url)
- # not enrolled in any courses
- self.assertEquals(response.status_code, 200)
-
- enrollment = CourseEnrollment.get_or_create_enrollment(self.user, self.course_key)
- enrollment.update_enrollment(mode="verified", is_active=True)
- MidcourseReverificationWindowFactory(course_id=self.course_key)
- response = self.client.get(url)
- # enrolled in a verified course, and the window is open
- self.assertEquals(response.status_code, 200)
-
- @patch('verify_student.views.render_to_response', render_mock)
- def test_midcourse_reverify_invalid_course_id(self):
- # if course id is invalid return 400
- invalid_course_key = CourseLocator('edx', 'not', 'valid')
- url = reverse('verify_student_midcourse_reverify', kwargs={'course_id': unicode(invalid_course_key)})
- response = self.client.get(url)
- self.assertEqual(response.status_code, 404)
-
-
-class TestReverificationBanner(ModuleStoreTestCase):
- """
- Tests for toggling the "midcourse reverification failed" banner off.
- """
-
- @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True})
- def setUp(self):
- super(TestReverificationBanner, self).setUp()
-
- self.user = UserFactory.create(username="rusty", password="test")
- self.client.login(username="rusty", password="test")
- self.course_id = 'Robot/999/Test_Course'
- CourseFactory.create(org='Robot', number='999', display_name=u'Test Course é')
- self.window = MidcourseReverificationWindowFactory(course_id=self.course_id)
- url = reverse('verify_student_midcourse_reverify', kwargs={'course_id': self.course_id})
- self.client.post(url, {'face_image': ','})
- photo_verification = SoftwareSecurePhotoVerification.objects.get(user=self.user, window=self.window)
- photo_verification.status = 'denied'
- photo_verification.save()
-
- def test_banner_display_off(self):
- self.client.post(reverse('verify_student_toggle_failed_banner_off'))
- photo_verification = SoftwareSecurePhotoVerification.objects.get(user=self.user, window=self.window)
- self.assertFalse(photo_verification.display)
-
-
class TestInCourseReverifyView(ModuleStoreTestCase):
"""
Tests for the incourse reverification views.
diff --git a/lms/djangoapps/verify_student/urls.py b/lms/djangoapps/verify_student/urls.py
index c349de245b..fd159e4dfa 100644
--- a/lms/djangoapps/verify_student/urls.py
+++ b/lms/djangoapps/verify_student/urls.py
@@ -95,42 +95,18 @@ urlpatterns = patterns(
name="verify_student_reverify"
),
- url(
- r'^midcourse_reverify/{}/$'.format(settings.COURSE_ID_PATTERN),
- views.MidCourseReverifyView.as_view(), # pylint: disable=no-value-for-parameter
- name="verify_student_midcourse_reverify"
- ),
-
url(
r'^reverification_confirmation$',
views.reverification_submission_confirmation,
name="verify_student_reverification_confirmation"
),
- url(
- r'^midcourse_reverification_confirmation$',
- views.midcourse_reverification_confirmation,
- name="verify_student_midcourse_reverification_confirmation"
- ),
-
- url(
- r'^midcourse_reverify_dash$',
- views.midcourse_reverify_dash,
- name="verify_student_midcourse_reverify_dash"
- ),
-
url(
r'^reverification_window_expired$',
views.reverification_window_expired,
name="verify_student_reverification_window_expired"
),
- url(
- r'^toggle_failed_banner_off$',
- views.toggle_failed_banner_off,
- name="verify_student_toggle_failed_banner_off"
- ),
-
url(
r'^submit-photos/$',
views.submit_photos_for_verification,
diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py
index 7d6fe5fdd3..2508a7545e 100644
--- a/lms/djangoapps/verify_student/views.py
+++ b/lms/djangoapps/verify_student/views.py
@@ -63,9 +63,6 @@ from django.contrib.auth.models import User
log = logging.getLogger(__name__)
-EVENT_NAME_USER_ENTERED_MIDCOURSE_REVERIFY_VIEW = 'edx.course.enrollment.reverify.started'
-EVENT_NAME_USER_SUBMITTED_MIDCOURSE_REVERIFY = 'edx.course.enrollment.reverify.submitted'
-EVENT_NAME_USER_REVERIFICATION_REVIEWED_BY_SOFTWARESECURE = 'edx.course.enrollment.reverify.reviewed'
EVENT_NAME_USER_ENTERED_INCOURSE_REVERIFY_VIEW = 'edx.bi.reverify.started'
EVENT_NAME_USER_SUBMITTED_INCOURSE_REVERIFY = 'edx.bi.reverify.submitted'
@@ -1024,12 +1021,6 @@ def results_callback(request):
"Result {} not understood. Known results: PASS, FAIL, SYSTEM FAIL".format(result)
)
- # If this is a reverification, log an event
- if attempt.window:
- course_id = attempt.window.course_id
- course_enrollment = CourseEnrollment.get_or_create_enrollment(attempt.user, course_id)
- course_enrollment.emit_event(EVENT_NAME_USER_REVERIFICATION_REVIEWED_BY_SOFTWARESECURE)
-
incourse_reverify_enabled = InCourseReverificationConfiguration.current().enabled
if incourse_reverify_enabled:
checkpoints = VerificationCheckpoint.objects.filter(photo_verification=attempt).all()
@@ -1102,122 +1093,6 @@ class ReverifyView(View):
return render_to_response("verify_student/photo_reverification.html", context)
-class MidCourseReverifyView(View):
- """
- The mid-course reverification view.
- Needs to perform these functions:
- - take new face photo
- - retrieve the old id photo
- - submit these photos to photo verification service
-
- Does not need to worry about pricing
- """
- @method_decorator(login_required)
- def get(self, request, course_id):
- """
- display this view
- """
- course_id = CourseKey.from_string(course_id)
- course = modulestore().get_course(course_id)
- if course is None:
- raise Http404
-
- course_enrollment = CourseEnrollment.get_or_create_enrollment(request.user, course_id)
- course_enrollment.update_enrollment(mode="verified")
- course_enrollment.emit_event(EVENT_NAME_USER_ENTERED_MIDCOURSE_REVERIFY_VIEW)
- context = {
- "user_full_name": request.user.profile.name,
- "error": False,
- "course_id": course_id.to_deprecated_string(),
- "course_name": course.display_name_with_default,
- "course_org": course.display_org_with_default,
- "course_num": course.display_number_with_default,
- "reverify": True,
- }
-
- return render_to_response("verify_student/midcourse_photo_reverification.html", context)
-
- @method_decorator(login_required)
- def post(self, request, course_id):
- """
- submits the reverification to SoftwareSecure
- """
- try:
- now = datetime.datetime.now(UTC)
- course_id = CourseKey.from_string(course_id)
- window = MidcourseReverificationWindow.get_window(course_id, now)
- if window is None:
- raise WindowExpiredException
- attempt = SoftwareSecurePhotoVerification(user=request.user, window=window)
- b64_face_image = request.POST['face_image'].split(",")[1]
-
- attempt.upload_face_image(b64_face_image.decode('base64'))
- attempt.fetch_photo_id_image()
- attempt.mark_ready()
-
- attempt.save()
- attempt.submit()
- course_enrollment = CourseEnrollment.get_or_create_enrollment(request.user, course_id)
- course_enrollment.update_enrollment(mode="verified")
- course_enrollment.emit_event(EVENT_NAME_USER_SUBMITTED_MIDCOURSE_REVERIFY)
- return HttpResponseRedirect(reverse('verify_student_midcourse_reverification_confirmation'))
-
- except WindowExpiredException:
- log.exception(
- "User {} attempted to re-verify, but the window expired before the attempt".format(request.user.id)
- )
- return HttpResponseRedirect(reverse('verify_student_reverification_window_expired'))
-
- except Exception:
- log.exception(
- "Could not submit verification attempt for user {}".format(request.user.id)
- )
- context = {
- "user_full_name": request.user.profile.name,
- "error": True,
- }
- return render_to_response("verify_student/midcourse_photo_reverification.html", context)
-
-
-@login_required
-def midcourse_reverify_dash(request):
- """
- Shows the "course reverification dashboard", which displays the reverification status (must reverify,
- pending, approved, failed, etc) of all courses in which a student has a verified enrollment.
- """
- user = request.user
- course_enrollment_pairs = []
- for enrollment in CourseEnrollment.enrollments_for_user(user):
- try:
- course_enrollment_pairs.append((modulestore().get_course(enrollment.course_id), enrollment))
- except ItemNotFoundError:
- log.error(u"User %s enrolled in non-existent course %s", user.username, enrollment.course_id)
-
- statuses = ["approved", "pending", "must_reverify", "denied"]
-
- reverifications = reverification_info(course_enrollment_pairs, user, statuses)
-
- context = {
- "user_full_name": user.profile.name,
- 'reverifications': reverifications,
- 'referer': request.META.get('HTTP_REFERER'),
- 'billing_email': settings.PAYMENT_SUPPORT_EMAIL,
- }
- return render_to_response("verify_student/midcourse_reverify_dash.html", context)
-
-
-@login_required
-@require_POST
-def toggle_failed_banner_off(request):
- """
- Finds all denied midcourse reverifications for a user and permanently toggles
- the "Reverification Failed" banner off for those verifications.
- """
- user_id = request.user.id
- SoftwareSecurePhotoVerification.display_off(user_id)
- return HttpResponse('Success')
-
-
@login_required
def reverification_submission_confirmation(_request):
"""
@@ -1226,14 +1101,6 @@ def reverification_submission_confirmation(_request):
return render_to_response("verify_student/reverification_confirmation.html")
-@login_required
-def midcourse_reverification_confirmation(_request): # pylint: disable=invalid-name
- """
- Shows the user a confirmation page if the submission to SoftwareSecure was successful
- """
- return render_to_response("verify_student/midcourse_reverification_confirmation.html")
-
-
@login_required
def reverification_window_expired(_request):
"""
diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html
index 3aa2f8acb7..ee228c0802 100644
--- a/lms/templates/courseware/courseware.html
+++ b/lms/templates/courseware/courseware.html
@@ -132,7 +132,6 @@ ${fragment.foot_html()}
%block>
-<%include file="/dashboard/_dashboard_prompt_midcourse_reverify.html" />
% if default_tab:
<%include file="/courseware/course_navigation.html" />
% else:
diff --git a/lms/templates/courseware/info.html b/lms/templates/courseware/info.html
index 730175cde0..6b26e981db 100644
--- a/lms/templates/courseware/info.html
+++ b/lms/templates/courseware/info.html
@@ -11,7 +11,6 @@
<%static:css group='style-course'/>
%block>
-<%include file="/dashboard/_dashboard_prompt_midcourse_reverify.html" />
% if show_enroll_banner:
diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html
index 71356892f5..0af84bcbc8 100644
--- a/lms/templates/courseware/progress.html
+++ b/lms/templates/courseware/progress.html
@@ -37,7 +37,6 @@ from django.utils.http import urlquote_plus
%block>
-<%include file="/dashboard/_dashboard_prompt_midcourse_reverify.html" />
<%include file="/courseware/course_navigation.html" args="active_page='progress'" />
diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html
index b47c51f931..3aa8a4b36a 100644
--- a/lms/templates/dashboard.html
+++ b/lms/templates/dashboard.html
@@ -42,21 +42,13 @@
edx.dashboard.legacy.init({
dashboard: "${reverse('dashboard')}",
signInUser: "${reverse('signin_user')}",
- changeEmailSettings: "${reverse('change_email_settings')}",
- verifyToggleBannerFailedOff: "${reverse('verify_student_toggle_failed_banner_off')}",
+ changeEmailSettings: "${reverse('change_email_settings')}"
});
});
%block>
- % if reverifications["must_reverify"] or reverifications["denied"]:
- ## Section Element must be outside of the re-verify template. The template is re-used for courseware, and has separate styling.
-
- <%include file='dashboard/_dashboard_prompt_midcourse_reverify.html' />
-
- % endif
-
%if message:
${message}
@@ -175,8 +167,6 @@
<%include file='dashboard/_dashboard_status_verification.html' />
- <%include file='dashboard/_dashboard_reverification_sidebar.html' />
-
diff --git a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
deleted file mode 100644
index 8b8f5a4ea5..0000000000
--- a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<%! from django.utils.translation import ugettext as _ %>
-<%! from django.core.urlresolvers import reverse %>
-
-% if reverifications:
- % if reverifications["must_reverify"]:
- % if len(reverifications["must_reverify"]) > 1:
-
-
-
-
-
${_("You need to re-verify to continue")}
-
-
- ${_("People change, and each year we ask you to re-verify your identity for our verified certificates. Take a minute now to help us renew your identity.")}
-
-
- % for item in reverifications["must_reverify"]:
-
- ${_('{course_name}: Re-verify by {date}').format(
- course_name=u"{0} ".format(item.course_name),
- date=item.date
- )}
-
- % endfor
-
-
-
-
- ${_('Notification Actions')}
-
-
-
-
-
- % elif reverifications["must_reverify"]:
-
-
-
-
${_("You need to re-verify to continue")}
- % for item in reverifications["must_reverify"]:
-
-
- ${_('To continue in the ID Verified track in {course_name}, you need to re-verify your identity by {date}.').format(
- course_name=u"{} ".format(item.course_name),
- date=item.date
- )}
-
-
-
-
- ${_('Notification Actions')}
-
-
-
-
- % endfor
- %endif
- %endif
-
- %if reverifications["denied"] and denied_banner:
-
-
-
-
${_("Your re-verification failed")}
- % for item in reverifications["denied"]:
- % if item.display:
-
-
- ${_('Your re-verification for {course_name} failed and you are no longer eligible for a Verified Certificate. If you think this is in error, please contact us at {email}.').format(
- course_name=u"{} ".format(item.course_name),
- email=u'{email} '.format(
- email=billing_email
- )
- )}
-
-
- % endif
- % endfor
-
-
- ${_('Dismiss')}
-
-
-
- %endif
-%endif
diff --git a/lms/templates/dashboard/_dashboard_reverification_sidebar.html b/lms/templates/dashboard/_dashboard_reverification_sidebar.html
deleted file mode 100644
index eb165ffb8d..0000000000
--- a/lms/templates/dashboard/_dashboard_reverification_sidebar.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<%! from django.utils.translation import ugettext as _ %>
-<%! from django.core.urlresolvers import reverse %>
-## TODO replace this with something a clever deisgn person approves of
-## TODO replace this with a shiny loopy thing to actually print out all courses
-
-% if reverifications["must_reverify"] or reverifications["pending"] or reverifications["denied"] or reverifications["approved"]:
-
- ${_("Re-verification now open for:")}
-
-
-
- % if reverifications["must_reverify"]:
- % for item in reverifications["must_reverify"]:
- ${_('Re-verify now:')} ${item.course_name}
- % endfor
- %endif
-
- % if reverifications["pending"]:
- % for item in reverifications["pending"]:
- ${_('Pending:')} ${item.course_name}
- % endfor
- %endif
-
- % if reverifications["denied"]:
- % for item in reverifications["denied"]:
- ${_('Denied:')} ${item.course_name}
- % endfor
- %endif
-
- % if reverifications["approved"]:
- % for item in reverifications["approved"]:
- ${_('Approved:')} ${item.course_name}
- % endfor
- %endif
-
-
-%endif
diff --git a/lms/templates/verify_student/midcourse_photo_reverification.html b/lms/templates/verify_student/midcourse_photo_reverification.html
deleted file mode 100644
index 2ae5b14b44..0000000000
--- a/lms/templates/verify_student/midcourse_photo_reverification.html
+++ /dev/null
@@ -1,197 +0,0 @@
-<%! from django.utils.translation import ugettext as _ %>
-<%! from django.core.urlresolvers import reverse %>
-<%inherit file="../main.html" />
-<%namespace name='static' file='/static_content.html'/>
-
-<%block name="bodyclass">midcourse-reverification-process is-not-verified step-photos register%block>
-<%block name="pagetitle">${_("Re-Verify")}%block>
-
-<%block name="js_extra">
-
-
-
-%block>
-
-
-<%block name="content">
-
-
-
-
-
-
${_("No Webcam Detected")}
-
-
${_("You don't seem to have a webcam connected. Double-check that your webcam is connected and working to continue.")}
-
-
-
-
-
-
-
-
-
-
${_("No Flash Detected")}
-
-
${_("You don't seem to have Flash installed. {a_start} Get Flash {a_end} to continue your registration.").format(a_start='', a_end=" ")}
-
-
-
-
-
-%if error:
-
-
-
-
-
${_("Error submitting your images")}
-
-
${_("Oops! Something went wrong. Please confirm your details and try again.")}
-
-
-
-
-%endif
-
-
-
-
-
-
-
-
-
- <%include file="_verification_header.html" args="course_name=course_name" />
-
-
-
-
${_("Re-Take Your Photo")}
-
-
${_("Use your webcam to take a picture of your face so we can match it with your original verification.")}
-
-
-
-
-
-
-
-
-
${_("Don't see your picture? Make sure to allow your browser to use your camera when it asks for permission.")}
-
-
-
-
-
-
-
-
-
-
-
-
${_("Tips on taking a successful photo")}
-
-
-
- ${_("Make sure your face is well-lit")}
- ${_("Be sure your entire face is inside the frame")}
- ${_("Can we match the photo you took with the one on your ID?")}
- ${_("Once in position, use the camera button {btn_icon} to capture your picture").format(btn_icon='( ) ')}
- ${_("Use the checkmark button {btn_icon} once you are happy with the photo").format(btn_icon='( ) ')}
-
-
-
-
-
-
${_("Common Questions")}
-
-
-
- ${_("Why do you need my photo?")}
- ${_("As part of the verification process, we need your photo to confirm that you are you.")}
-
- ${_("What do you do with this picture?")}
- ${_("We only use it to verify your identity. It is not displayed anywhere.")}
-
-
-
-
-
-
-
-
-
-
${_("Check Your Name")}
-
-
-
${_("Make sure your full name on your {platform_name} account ({full_name}) matches the ID you originally submitted. We will also use this as the name on your certificate.").format(
- full_name="{name} ".format(name=user_full_name),
- platform_name=settings.PLATFORM_NAME,
- )}
-
-
-
-
-
-
-
-
-
-
-
Before proceeding, please review carefully
-
-
${_("Once you verify your photo looks good and your name is correct, you can finish your re-verification and return to your course. Note: You will not have another chance to re-verify. ")}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%include file="_reverification_support.html" />
-
-
-
-<%include file="_modal_editname.html" />
-%block>
diff --git a/lms/templates/verify_student/midcourse_reverification_confirmation.html b/lms/templates/verify_student/midcourse_reverification_confirmation.html
deleted file mode 100644
index e612d6048a..0000000000
--- a/lms/templates/verify_student/midcourse_reverification_confirmation.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-<%! from django.utils.translation import ugettext as _ %>
-<%! from django.core.urlresolvers import reverse %>
-<%inherit file="../main.html" />
-<%namespace name='static' file='/static_content.html'/>
-
-<%block name="bodyclass">register verification-process is-not-verified step-confirmation%block>
-<%block name="pagetitle">${_("Re-Verification Submission Confirmation")}%block>
-
-<%block name="content">
-
-
-
-
-
-
-
-
-
- ## Translators: 'Credentials' refer to photographs the user has taken to verify their identity.
-
${_("Your Credentials Have Been Updated")}
-
-
-
${_("We have received your re-verification details and submitted them for review. Your dashboard will show the notification status once the review is complete.")}
-
${_("Please note: The professor may ask you to re-verify again at other key points in the course.")}
-
-
-
-
-
-
-
-
-
-
- <%include file="_reverification_support.html" />
-
-
-%block>
diff --git a/lms/templates/verify_student/midcourse_reverify_dash.html b/lms/templates/verify_student/midcourse_reverify_dash.html
deleted file mode 100644
index 9c0b0aae10..0000000000
--- a/lms/templates/verify_student/midcourse_reverify_dash.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<%! from django.utils.translation import ugettext as _ %>
-<%! from django.core.urlresolvers import reverse %>
-<%inherit file="../main.html" />
-<%block name="bodyclass">midcourse-reverification-process step-dash register%block>
-<%block name="pagetitle">${_("Reverification Status")}%block>
-
-<%block name="content">
-
-
-
-
-
- ${_("You are in the ID Verified track")}
-
-
-
- % if reverifications["must_reverify"]: # If you have reverifications to do
- % if len(reverifications["must_reverify"]) > 1: # If you have >1 reverifications
-
-
${_("You currently need to re-verify for the following courses:")}
-
-
-
- % else: # You only have one reverification
-
-
${_("You currently need to re-verify for the following course:")}
-
-
-
- %endif
- % else:
-
-
${_("You have no re-verifications at present.")}
-
- %endif
-
- % if reverifications["pending"] or reverifications["approved"] or reverifications["denied"]:
-
-
${_("The status of your submitted re-verifications:")}
-
-
- % for item in reverifications["pending"]:
-
-
-
${item.course_name} (${item.course_number})
-
${_('Re-verify by {date}').format(date="" + item.date + " ")}
-
- ${_("Pending")}
-
- % endfor
-
- % for item in reverifications["approved"]:
-
-
-
${item.course_name} (${item.course_number})
-
${_('Re-verify by {date}').format(date="" + item.date + " ")}
-
- ${_("Complete")}
-
- % endfor
-
- % for item in reverifications["denied"]:
-
-
-
${item.course_name} (${item.course_number})
-
${_('Re-verify by {date}').format(date="" + item.date + " ")}
-
- ${_("Failed")}
-
- % endfor
-
-
-
- % endif
-
- % if reverifications["must_reverify"]:
-
${_("Don't want to re-verify right now?") + u" {a_start}{text}{a_end}".format(
- text=_("Return to where you left off"),
- a_start=''.format(url=referer),
- a_end=" ",
- )}
- % else:
-
${u"{a_start}{text}{a_end}".format(
- text=_("Return to where you left off"),
- a_start=''.format(url=referer),
- a_end=" ",
- )}
- % endif
-
-
-
-
-
-
-
${_("Why do I need to re-verify?")}
-
-
-
${_("At key points in a course, the professor will ask you to re-verify your identity by submitting a new photo of your face. We will send the new photo to be matched up with the photo of the original ID you submitted when you signed up for the course. If you are taking multiple courses, you may need to re-verify multiple times, once for every important point in each course you are taking as a verified student.")}
-
-
-
-
-
${_("What will I need to re-verify?")}
-
-
-
${_("Because you are just confirming that you are still you, the only thing you will need to do to re-verify is to submit a new photo of your face with your webcam . The process is quick and you will be brought back to where you left off so you can keep on learning.")}
-
-
${_("If you changed your name during the semester and it no longer matches the original ID you submitted, you will need to re-edit your name to match as well.")}
-
-
-
-
-
${_("What if I have trouble with my re-verification?")}
-
-
${_('Because of the short time that re-verification is open, you will not be able to correct a failed verification . If you think there was an error in the review, please contact us at {email}').format(email='{email} .'.format(email=billing_email))}
-
-
-
-
-
-
-
-
-
-%block>