Exemple #1
0
def password_reset_done_view(request):
    extra_context = {'appearance_type': 'plain'}

    return password_reset_done(
        request,
        extra_context=extra_context,
        template_name='authentication/password_reset_done.html')
Exemple #2
0
def password_reset_done(request):
    context = dict()

    return auth_views.password_reset_done(
        request,
        extra_context=context,
        template_name="accounts/password_reset_done.html")
Exemple #3
0
def password_reset_done(request, *args, **kwargs):
    """Wrapper for auth.password_reset_done."""
    if 'extra_context' not in kwargs:
        kwargs['extra_context'] = {}
    kwargs['extra_context']['title'] = 'Reset instructions sent'
    kwargs['extra_context']['message'] = "We’ve sent instructions for resetting your password to the email address you submitted."
    return auth_views.password_reset_done(request, *args, **kwargs)
def password_reset_done(request, *args, **kwargs):
    defaults = {
        'template_name': 'accounts/password_reset_done.html',
    }
    for key, value in defaults.items():
        kwargs.setdefault(key, value)
    return auth.password_reset_done(request, *args, **kwargs)
Exemple #5
0
def password_reset_done(request):
    response = views.password_reset_done(
        request=request,
        template_name='password_reset/password_reset_done.html',
        current_app=None,
        extra_context=None)
    return response
Exemple #6
0
def password_reset(request):
    if request.method == 'POST':
        response = auth_views.password_reset_done(request)
        return response
    else:
        form = UserPasswordResetForm()
        return render(request, 'accounts/password_reset_form.html', {'form': form})
Exemple #7
0
def forgot_password(request):
    if 'status' in request.GET:
        if request.GET['status'] == 'done':
            return password_reset_done(request,
                                       'accounts/forgot_password.html',
                                       {'done': True})
        elif request.GET['status'] == 'confirm':
            return password_reset_confirm(
                request,
                request.GET['uid'],
                request.GET['token'],
                'accounts/forgot_password.html',
                extra_context={'confirm': True},
                post_reset_redirect='/accounts/forgot_password?status=complete'
            )
        elif request.GET['status'] == 'complete':
            return password_reset_complete(request,
                                           'accounts/forgot_password.html',
                                           {'complete': True})
    else:
        return password_reset(
            request,
            'accounts/forgot_password.html',
            post_reset_redirect='/accounts/forgot_password?status=done',
            email_template_name='accounts/reset_password_email.html',
            subject_template_name='accounts/reset_password_email_subject.txt')
def password_reset_done2(request):
        """
        django.contrib.auth.views.password_reset_done - after password reset view
        """
        if not request.user.is_authenticated():
            return password_reset_done(request, template_name='password_reset_done.html')
        else:
            return HttpResponseRedirect(reverse("personal_data"))
Exemple #9
0
def password_reset_done(request, *args, **kwargs):
    """Wrapper for auth.password_reset_done."""
    if 'extra_context' not in kwargs:
        kwargs['extra_context'] = {}
    kwargs['extra_context']['title'] = 'Reset instructions sent'
    kwargs['extra_context'][
        'message'] = "We’ve sent instructions for resetting your password to the email address you submitted."
    return auth_views.password_reset_done(request, *args, **kwargs)
def password_reset_done(request):
    # The page shown after a user has been emailed a link to reset their password.
    return views.password_reset_done(
        request,
        template_name='accounts/password_reset_done.html',
        # current_app=None,
        # extra_context={}
    )
Exemple #11
0
def password_reset_done2(request):
    """
        django.contrib.auth.views.password_reset_done - after password reset view
        """
    if not request.user.is_authenticated():
        return password_reset_done(request,
                                   template_name='password_reset_done.html')
    else:
        return HttpResponseRedirect(reverse("personal_data"))
Exemple #12
0
 def render_to_response(self, context, **response_kwargs):
     user = self.request.user
     send_mail('Password has been updated',
               co.UPDATE_PASSWORD_EMAIL % {'first_name': user.first_name},
               co.ADMIN_EMAIL, [user.email])
     context.update(self.settings)
     return password_reset_done(request=self.request,
                                template_name=self.get_template_names(),
                                extra_context=context)
Exemple #13
0
def password_reset_done_view(request):
    extra_context = {
        'appearance_type': 'plain'
    }

    return password_reset_done(
        request, extra_context=extra_context,
        template_name='authentication/password_reset_done.html'
    )
Exemple #14
0
def reset_done(request, **kwargs):
    state = "We've emailed you instructions for setting your password. " +\
            "You should be receiving them shortly.\n\n" +\
            "If you don't receive an email, " +\
            "please make sure you've entered the address you " +\
            "registered with, and check your spam folder."
    return password_reset_done(
        request,
        template_name="registration/password_reset_done.html",
        extra_context={'state': state, })
Exemple #15
0
def custom_password_reset_done(request,
                               template_name='registration/password_reset_done.html',
                               current_app=None, extra_context=None):
    if extra_context:
        extra_context.update({'anonym_user_email': request.session.get('anonym_user_email')})
    else:
        extra_context = {'anonym_user_email': request.session.get('anonym_user_email')}
    return password_reset_done(request,
                               template_name=template_name,
                               current_app=current_app, extra_context=extra_context)
Exemple #16
0
def password_reset_done2(request):
    """
        django.contrib.auth.views.password_reset_done - after password reset view
        """
    saveViewsLog(request, "apps.account.views.password_reset_done2")
    if not request.user.is_authenticated():
        return password_reset_done(
            request, template_name='account/password_reset_done.html')
    else:
        return HttpResponseRedirect("/account/")
Exemple #17
0
 def password_reset_done(self, request, extra_context=None):
   """
   Displays the "success" page after a password reset.
   """
   from django.contrib.auth.views import password_reset_done
   defaults = {
     'extra_context': extra_context or {},
     'template_name': 'auth/password_reset_done.html'
   }
   return password_reset_done(request, **defaults)
Exemple #18
0
def password_reset_done(request):
    """
    The page  shown after a user has been emailed a link to reset their password.
    This view is called after email with a link  was sent to the user.
    Returns template response too.
    """
    template_response = views.password_reset_done(request,
                                                  template_name='login/password_reset_done.html',
                                                  current_app='login')

    return template_response
def pass_reset_done(request):
	
	'''
	This view display messages
	that successful send email
	'''
	return password_reset_done(
		request,
		template_name='baseapp/password_reset_done.html',
		current_app=None, extra_context=None
	)
Exemple #20
0
def cust_password_reset_done(request):
    """Use ``django.contrib.auth.views.password_reset_done`` view method for
    forgotten password on the Customer UI

    This will show a message to the user who is seeking to reset their
    password.
    """
    if not request.user.is_authenticated():
        data = {'loginform': LoginForm()}
        return password_reset_done(
            request, template_name='frontend/registration/password_reset_done.html',
            extra_context=data)
    else:
        return HttpResponseRedirect("/")
    def password_reset_done(
            request, template_name='registration/password_reset_done.html',
            current_app=None, extra_context=None):
        tpt_response = auth_views.password_reset_done(
            request, template_name, current_app, extra_context)
        text = tpt_response.rendered_content
        last_p_idx = text.rfind('</p>')
        # If the template contains no <p> tags,
        if last_p_idx == -1:
            # Give up, return the stock template.
            return tpt_response

        # If the last <p> tag was found, append our note after it.
        tpt_response.content = text[:last_p_idx] + '</p>\n' + _reset_extra_text
        return tpt_response
Exemple #22
0
def password_reset_done(request, *args, **kwargs):
    errorMessage, warningMessage, infoMessage = get_session_messages(request)
    template_response = auth_views.password_reset_done(request, *args, **kwargs)
    if template_response.status_code == 302:
        # if we redirect, no need to change the response data
        return template_response
    template_response.context_data.update({
                                           'errorMessage':errorMessage,
                                            'warningMessage':warningMessage,
                                            'infoMessage':infoMessage,
						                    'adminName':adminName,
						                    'adminEmail':adminEmail,
						                    'siteVersion':siteVersion,
						                    'imsVersion':imsVersion,})
    return template_response
Exemple #23
0
def cust_password_reset_done(request):
    """Use ``django.contrib.auth.views.password_reset_done`` view method for
    forgotten password on the Customer UI

    This will show a message to the user who is seeking to reset their
    password.
    """
    if not request.user.is_authenticated():
        data = {'loginform': LoginForm()}
        return password_reset_done(
            request,
            template_name='frontend/registration/password_reset_done.html',
            extra_context=data)
    else:
        return HttpResponseRedirect("/")
    def test_titles(self):
        rf = RequestFactory()
        user = User.objects.create_user('jsmith', '*****@*****.**', 'pass')
        user = authenticate(username=user.username, password='******')
        request = rf.get('/somepath/')
        request.user = user

        response = password_reset(request, post_reset_redirect='dummy/')
        self.assertContains(response, '<title>Password reset</title>')
        self.assertContains(response, '<h1>Password reset</h1>')

        response = password_reset_done(request)
        self.assertContains(response,
                            '<title>Password reset successful</title>')
        self.assertContains(response, '<h1>Password reset successful</h1>')

        # password_reset_confirm invalid token
        response = password_reset_confirm(request,
                                          uidb64='Bad',
                                          token='Bad',
                                          post_reset_redirect='dummy/')
        self.assertContains(response,
                            '<title>Password reset unsuccessful</title>')
        self.assertContains(response, '<h1>Password reset unsuccessful</h1>')

        # password_reset_confirm valid token
        default_token_generator = PasswordResetTokenGenerator()
        token = default_token_generator.make_token(user)
        uidb64 = force_text(urlsafe_base64_encode(force_bytes(user.pk)))
        response = password_reset_confirm(request,
                                          uidb64,
                                          token,
                                          post_reset_redirect='dummy/')
        self.assertContains(response, '<title>Enter new password</title>')
        self.assertContains(response, '<h1>Enter new password</h1>')

        response = password_reset_complete(request)
        self.assertContains(response, '<title>Password reset complete</title>')
        self.assertContains(response, '<h1>Password reset complete</h1>')

        response = password_change(request, post_change_redirect='dummy/')
        self.assertContains(response, '<title>Password change</title>')
        self.assertContains(response, '<h1>Password change</h1>')

        response = password_change_done(request)
        self.assertContains(response,
                            '<title>Password change successful</title>')
        self.assertContains(response, '<h1>Password change successful</h1>')
Exemple #25
0
def password_reset_done(request, *args, **kwargs):
    errorMessage, warningMessage, infoMessage = get_session_messages(request)
    template_response = auth_views.password_reset_done(request, *args,
                                                       **kwargs)
    if template_response.status_code == 302:
        # if we redirect, no need to change the response data
        return template_response
    template_response.context_data.update({
        'errorMessage': errorMessage,
        'warningMessage': warningMessage,
        'infoMessage': infoMessage,
        'adminName': adminName,
        'adminEmail': adminEmail,
        'siteVersion': siteVersion,
        'imsVersion': imsVersion,
    })
    return template_response
Exemple #26
0
    def test_titles(self):
        rf = RequestFactory()
        user = User.objects.create_user('jsmith', '*****@*****.**', 'pass')
        user = authenticate(username=user.username, password='******')
        request = rf.get('/somepath/')
        request.user = user

        response = password_reset(request, post_reset_redirect='dummy/')
        self.assertContains(response, '<title>Password reset</title>')
        self.assertContains(response, '<h1>Password reset</h1>')

        response = password_reset_done(request)
        self.assertContains(response, '<title>Password reset sent</title>')
        self.assertContains(response, '<h1>Password reset sent</h1>')

        # password_reset_confirm invalid token
        response = password_reset_confirm(request, uidb64='Bad', token='Bad', post_reset_redirect='dummy/')
        self.assertContains(response, '<title>Password reset unsuccessful</title>')
        self.assertContains(response, '<h1>Password reset unsuccessful</h1>')

        # password_reset_confirm valid token
        default_token_generator = PasswordResetTokenGenerator()
        token = default_token_generator.make_token(user)
        uidb64 = force_text(urlsafe_base64_encode(force_bytes(user.pk)))
        response = password_reset_confirm(request, uidb64, token, post_reset_redirect='dummy/')
        self.assertContains(response, '<title>Enter new password</title>')
        self.assertContains(response, '<h1>Enter new password</h1>')

        response = password_reset_complete(request)
        self.assertContains(response, '<title>Password reset complete</title>')
        self.assertContains(response, '<h1>Password reset complete</h1>')

        response = password_change(request, post_change_redirect='dummy/')
        self.assertContains(response, '<title>Password change</title>')
        self.assertContains(response, '<h1>Password change</h1>')

        response = password_change_done(request)
        self.assertContains(response, '<title>Password change successful</title>')
        self.assertContains(response, '<h1>Password change successful</h1>')
Exemple #27
0
def password_reset_done(request):
    template_response=views.password_reset_done(request)
    # Do something with the template response
    return  template_response
Exemple #28
0
def password_reset_done(request):
    response = views.password_reset_done(request=request,
                        template_name='password_reset/password_reset_done.html',
                        current_app=None, extra_context=None)
    return response
Exemple #29
0
def reset_password_done(request):
    """Страница успешной смены пароля"""
    return password_reset_done(request,
                               template_name="password_reset_done.html")
Exemple #30
0
 def render_to_response(self, context, **response_kwargs):
     context.update(self.settings)
     return password_reset_done(request=self.request,
                                template_name=self.get_template_names(),
                                extra_context=context)
Exemple #31
0
def password_reset_done(request):
    return aviews.password_reset_done(request,
        template_name='password_reset_done.html')
Exemple #32
0
def reset_password_done(request):
    template_name = 'registration/reset_my_password_done.html'
    return password_reset_done(request, template_name=template_name)
Exemple #33
0
def reset_done(request):
    return password_reset_done(request,
                               template_name='password_reset_done.html')
Exemple #34
0
def reset_done(request):
	return authviews.password_reset_done(request, template_name='account/password_reset_done.html')
Exemple #35
0
def password_reset_done(request):
    return auth_views.password_reset_done(
        request, template_name="base/auth/forgot_password_done.html")
Exemple #36
0
def password_reset_done(request):
    context = {'template_name': 'main_app/password_reset_done.html'}
    return authv.password_reset_done(request, **context)
Exemple #37
0
def reset_accepted(request):
    return auth_views.password_reset_done(
        request,
        template_name='accounts/password/reset/accepted.html',
        extra_context=None)
Exemple #38
0
def password_reset_done(request):
    #发送邮件完成跳转到这里
    return auth_views.password_reset_done(request, template_name='password/password_reset_done.html')
Exemple #39
0
def password_reset_done(request):
    return auth_views.password_reset_done(
        request,
        template_name='accounts/password_reset_done.html',
    )
Exemple #40
0
def reset_done(request):
    return password_reset_done(request, template_name='password_reset_done.html')
Exemple #41
0
 url(r'^logout/$', views.logout_view, name='logout'),
 url(r'^reset/$', lambda req, **kwargs: auth_views.password_reset(
   req, template_name='form.html',
   from_email=views.PASSWORD_EMAIL_SENDER,
   email_template_name='reset_password_email.html',
   post_reset_redirect=reverse_lazy('auth:password_reset_done'),
   extra_context={
       'validlink': True,
       'form_title': 'Forgot Password',
       'form_submit': 'Retreive Password',
   }, **kwargs
   ), name='password_reset'),
 url(r'^reset/retreive/$', lambda req, **kwargs: auth_views.password_reset_done(
   req, template_name='message.html',
   # post_reset_redirect='auth.password_reset_done',
   extra_context={
       'message_title': 'Forgot Password',
       'message_content': views.PASSWORD_RESET_DONE_MSG,
   }, **kwargs
   ), name='password_reset_done'),
 url(views.PASSWORD_RESET_TOKEN_REGEX, lambda req, **kwargs: auth_views.password_reset_confirm(
         req, template_name='form.html',
         post_reset_redirect=reverse_lazy('auth:password_reset_complete'),
         extra_context={
             'form_title': 'Reset Password',
             'form_submit': 'Reset',
             'exception_msg': views.PASSWORD_RESET_EX_MSG,
         }, **kwargs
     ), name='password_reset_confirm'),
 url(r'^reset/done/$', lambda req, **kwargs: auth_views.password_reset_complete(  # Ignore PycodestyleBear (E501)
     req, template_name='message.html',
     extra_context={
Exemple #42
0
def password_reset_complete(request):
    #邮件密码修改完成显示
    return auth_views.password_reset_done(request, template_name='password/password_reset_complete.html')
Exemple #43
0
def reset_done(request):
	log.info("Password reset done from {0}".format(get_client_ip(request)))
	return authviews.password_reset_done(request, template_name='account/password_reset_done.html')
Exemple #44
0
def password_reset_done(request):
    return aviews.password_reset_done(request,
                                      template_name='password_reset_done.html')
Exemple #45
0
def reset_done(request):
	log.info("Password reset done from {0}".format(get_client_ip(request)))
	return authviews.password_reset_done(request, template_name='account/password_reset_done.html')
Exemple #46
0
def password_reset_done(request, **kwargs):
    # Hide message from undefined paths
    if not request.session.pop('used_reset_form', False):
        return redirect('index')
    else:
        return auth_views.password_reset_done(request, **kwargs)
Exemple #47
0
def password_reset_done(request):
    return views.password_reset_done(request, 'registration/password_reset_done.html')
Exemple #48
0
def password_reset_done(request, *args, **kwargs):
    kwargs.update({
        'template_name':
        'aldryn_accounts/reset/password_reset_done.html',
    })
    return auth_views.password_reset_done(request, *args, **kwargs)
Exemple #49
0
def cust_password_reset_done(request):
    if not request.user.is_authenticated():
        return password_reset_done(request,  
            template_name='registration/password_reset_done.html')
    else:
        return HttpResponseRedirect("/")
def reset_password_done(request):
    return auth_views.password_reset_done(request, password_reset_form=CustomResetForm)
Exemple #51
0
def email_receive_confirm(request):
	return password_reset_done(request,
								template_name='home.html',
								extra_context={'regis_form':RegistrationForm,'search_form':SearchForm,'login_form':LoginForm,
								'request':request,'email_from':EmailEnterForm,'movie_combos':get_in_theater_movies()})
Exemple #52
0
 def get(self, request, *args, **kwargs):
     return auth_views.password_reset_done(request,
                                           template_name=self.template_name,
                                           current_app=None,
                                           extra_context=None)
Exemple #53
0
def reset_done(request):
    return password_reset_done(request, template_name="registration/reset_password_done.html")
Exemple #54
0
def reset_done(request):
    """Indicates the user that he will receive an email to reset the password. This appears even if the email introduced is not associated to any account"""
    return password_reset_done(
        request,
        template_name='accounts/registration/password_reset_done.html')
Exemple #55
0
def password_reset_done(request):
    return auth_views.password_reset_done(request, template_name="base/auth/forgot_password_done.html")
Exemple #56
0
def password_reset_done(request):
    return aviews.password_reset_done(request,
        template_name='password_reset_done.html',
        extra_context={})
Exemple #57
0
def password_reset_done(request):
    response = auth_views.password_reset_done(request)

    return response
Exemple #58
0
def user_password_reset_done(request):
    return password_reset_done(
        request, template_name='registration/user_password_reset_done.html')
Exemple #59
0
        name='password_change_done'),

    url(r'^password-reset/$', lambda request, **kwargs: password_reset(
        request, template_name='registration/password_reset.html',
        email_template_name='registration/password_reset_email.html',
        post_reset_redirect=reverse_lazy('account:password_reset_done'),
        extra_context={
            'validlink': True,
        },  **kwargs

        ), name='password_reset'),


    url(r'^password-reset-done/$', lambda request, **kwargs: password_reset_done(
        request,
        template_name='registration/password_reset_done.html',

        ), name='password_reset_done'),

    url(r'^password-reset/confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$',
            lambda request, **kwargs: password_reset_confirm(

              request, template_name='registration/password_reset_confirm.html',
              post_reset_redirect=reverse_lazy('account:password_reset_complete'),
              extra_context={
                    'form_title': 'Reset Password',
                    'form_submit': 'Reset',
                    'exception_msg': views.PASSWORD_RESET_EX_MSG,
                }, **kwargs

            ), name='password_reset_confirm'),
Exemple #60
0
def password_reset_done(request):
    return auth_views.password_reset_done(
        request=request,
        template_name="auth/password_reset_done.html"
    )