示例#1
0
    def get(self, request):
        """
        Render the reverification flow.

        Most of the work is done client-side by composing the same
        Backbone views used in the initial verification flow.
        """
        verification_status = IDVerificationService.user_status(request.user)
        expiration_datetime = IDVerificationService.get_expiration_datetime(
            request.user, ['approved'])
        if can_verify_now(verification_status, expiration_datetime):
            if redirect_to_idv_microfrontend():
                return redirect('{}/id-verification'.format(
                    settings.ACCOUNT_MICROFRONTEND_URL))
            context = {
                "user_full_name":
                request.user.profile.name,
                "platform_name":
                configuration_helpers.get_value('PLATFORM_NAME',
                                                settings.PLATFORM_NAME),
                "capture_sound":
                staticfiles_storage.url("audio/camera_capture.wav"),
            }
            return render_to_response("verify_student/reverify.html", context)
        else:
            context = {"status": verification_status['status']}
            return render_to_response(
                "verify_student/reverify_not_allowed.html", context)
示例#2
0
 def get(self, request):
     """
     Handle the GET request.
     """
     verification_status = IDVerificationService.user_status(request.user)
     expiration_datetime = IDVerificationService.get_expiration_datetime(request.user, ['approved'])
     can_verify = can_verify_now(verification_status, expiration_datetime)
     data = {
         'status': verification_status['status'],
         'can_verify': can_verify,
     }
     if expiration_datetime:
         data['expires'] = expiration_datetime
     return Response(data)