示例#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')
示例#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")
示例#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)
示例#5
0
文件: views.py 项目: jicksy/SDS
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
示例#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})
示例#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')
示例#8
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"))
示例#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)
示例#10
0
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={}
    )
示例#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"))
示例#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)
示例#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'
    )
示例#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, })
示例#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)
示例#16
0
文件: views.py 项目: Daiech/Actarium
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/")
示例#17
0
文件: sites.py 项目: bubufox/HomeWork
 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)
示例#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
示例#19
0
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
	)
示例#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
示例#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
示例#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("/")
示例#24
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 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>')
示例#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
示例#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>')
示例#27
0
文件: views.py 项目: DBT7/Project1
def password_reset_done(request):
    template_response=views.password_reset_done(request)
    # Do something with the template response
    return  template_response
示例#28
0
文件: views.py 项目: jicksy/SDS
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
示例#29
0
def reset_password_done(request):
    """Страница успешной смены пароля"""
    return password_reset_done(request,
                               template_name="password_reset_done.html")
示例#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)
示例#31
0
文件: views.py 项目: sophilabs/pyuy
def password_reset_done(request):
    return aviews.password_reset_done(request,
        template_name='password_reset_done.html')
示例#32
0
def reset_password_done(request):
    template_name = 'registration/reset_my_password_done.html'
    return password_reset_done(request, template_name=template_name)
示例#33
0
文件: views.py 项目: isaubripi/is2
def reset_done(request):
    return password_reset_done(request,
                               template_name='password_reset_done.html')
示例#34
0
def reset_done(request):
	return authviews.password_reset_done(request, template_name='account/password_reset_done.html')
示例#35
0
文件: views.py 项目: tpabla/revolv
def password_reset_done(request):
    return auth_views.password_reset_done(
        request, template_name="base/auth/forgot_password_done.html")
示例#36
0
def password_reset_done(request):
    context = {'template_name': 'main_app/password_reset_done.html'}
    return authv.password_reset_done(request, **context)
示例#37
0
def reset_accepted(request):
    return auth_views.password_reset_done(
        request,
        template_name='accounts/password/reset/accepted.html',
        extra_context=None)
示例#38
0
def password_reset_done(request):
    #发送邮件完成跳转到这里
    return auth_views.password_reset_done(request, template_name='password/password_reset_done.html')
示例#39
0
def password_reset_done(request):
    return auth_views.password_reset_done(
        request,
        template_name='accounts/password_reset_done.html',
    )
示例#40
0
文件: views.py 项目: frvc123/sigp
def reset_done(request):
    return password_reset_done(request, template_name='password_reset_done.html')
示例#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={
示例#42
0
def password_reset_complete(request):
    #邮件密码修改完成显示
    return auth_views.password_reset_done(request, template_name='password/password_reset_complete.html')
示例#43
0
文件: views.py 项目: aklaver/pgweb
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')
示例#44
0
文件: views.py 项目: sophilabs/pyuy
def password_reset_done(request):
    return aviews.password_reset_done(request,
                                      template_name='password_reset_done.html')
示例#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')
示例#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)
示例#47
0
def password_reset_done(request):
    return views.password_reset_done(request, 'registration/password_reset_done.html')
示例#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)
示例#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)
示例#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()})
示例#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)
示例#53
0
def reset_done(request):
    return password_reset_done(request, template_name="registration/reset_password_done.html")
示例#54
0
文件: views.py 项目: GPCRmd/GPCRmd
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')
示例#55
0
def password_reset_done(request):
    return auth_views.password_reset_done(request, template_name="base/auth/forgot_password_done.html")
示例#56
0
def password_reset_done(request):
    return aviews.password_reset_done(request,
        template_name='password_reset_done.html',
        extra_context={})
示例#57
0
def password_reset_done(request):
    response = auth_views.password_reset_done(request)

    return response
示例#58
0
def user_password_reset_done(request):
    return password_reset_done(
        request, template_name='registration/user_password_reset_done.html')
示例#59
0
文件: urls.py 项目: Chipxiang/imageX
        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'),
示例#60
0
def password_reset_done(request):
    return auth_views.password_reset_done(
        request=request,
        template_name="auth/password_reset_done.html"
    )