Esempio n. 1
0
def password_reset_confirm(request, uidb36=None, token=None):
    response = django_password_reset_confirm(request, uidb36=uidb36, token=token,
            template_name='account/password_reset_confirm.html',
            post_reset_redirect=reverse('account-show'))
    if response.status_code == 302:
        uid_int = base36_to_int(uidb36)
        user = auth.models.User.objects.get(id=uid_int)
        login_user(request, user)
        messages.add_message(request, messages.SUCCESS,
                _('Your password has been set and you are now logged in.'))
    return response
Esempio n. 2
0
def password_reset_confirm(request, uidb36=None, token=None):
    response = django_password_reset_confirm(request, uidb36=uidb36, token=token,
            template_name='account/password_reset_confirm.html',
            post_reset_redirect=reverse('account-show'))
    # TODO: this is not the smartest of ideas
    # if django view returns 302, it is assumed that everything was fine
    # currently this seems safe to assume.
    if response.status_code == 302:
        uid_int = base36_to_int(uidb36)
        user = auth.models.User.objects.get(id=uid_int)
        login_user(request, user)
        messages.add_message(request, messages.SUCCESS,
                _('Your password has been set and you are now logged in.'))
    return response
Esempio n. 3
0
def password_reset_confirm(request, uidb36=None, token=None):
    response = django_password_reset_confirm(request, uidb36=uidb36, token=token,
            template_name='account/password_reset_confirm.html',
            post_reset_redirect=reverse('account-show'))
    # TODO: this is not the smartest of ideas
    # if django view returns 302, it is assumed that everything was fine
    # currently this seems safe to assume.
    if response.status_code == 302:
        uid_int = base36_to_int(uidb36)
        user = auth.models.User.objects.get(id=uid_int)
        login_user(request, user)
        messages.add_message(request, messages.SUCCESS,
                _('Your password has been set and you are now logged in.'))
        if 'next' in request.session:
            response['Location'] = request.session['next']
            del request.session['next']
    return response
Esempio n. 4
0
def password_reset_confirm(request, uidb64=None, token=None):
    """The view containing form to reset password and process it.

    :param request: A django request object.
    :type request: request

    :param uidb64: An unique ID of the user.
    :type uidb64: str

    :param token: Token to check if the reset password link is valid.
    :type token: str
    """
    return django_password_reset_confirm(
        request,
        uidb64=uidb64,
        token=token,
        template_name='user_map/account/password_reset_confirm.html',
        set_password_form=SetPasswordForm,
        post_reset_redirect=reverse('user_map:password_reset_complete'))
Esempio n. 5
0
def password_reset_confirm(request, uidb64=None, token=None):
    # TODO: Fix this code
    # - don't sniff response
    # - make redirect

    response = django_password_reset_confirm(request, uidb64=uidb64, token=token,
            template_name='account/password_reset_confirm.html',
            post_reset_redirect=reverse('account-show'))

    if response.status_code == 302:
        uid = urlsafe_base64_decode(uidb64)
        user = auth.get_user_model().objects.get(pk=uid)
        login_user(request, user)
        messages.add_message(request, messages.SUCCESS,
                _('Your password has been set and you are now logged in.'))
        if 'next' in request.session and is_safe_url(
                    url=request.session['next'],
                    host=request.get_host()):
            response['Location'] = request.session['next']
            del request.session['next']
    return response
Esempio n. 6
0
def password_reset_confirm(request, uidb64=None, token=None):
    # TODO: Fix this code
    # - don't sniff response
    # - make redirect

    response = django_password_reset_confirm(request, uidb64=uidb64, token=token,
            template_name='account/password_reset_confirm.html',
            post_reset_redirect=reverse('account-show'))

    if response.status_code == 302:
        uid = urlsafe_base64_decode(uidb64)
        user = auth.get_user_model().objects.get(pk=uid)
        login_user(request, user)
        messages.add_message(request, messages.SUCCESS,
                _('Your password has been set and you are now logged in.'))
        if 'next' in request.session and is_safe_url(
                    url=request.session['next'],
                    host=request.get_host()):
            response['Location'] = request.session['next']
            del request.session['next']
    return response
def password_reset_confirm(request, uidb36=None, token=None):
    return django_password_reset_confirm(
        request, uidb36, token,
        template_name='commons/password_reset_confirm.html',
        post_reset_redirect=reverse('password_reset_complete_view')
    )
Esempio n. 8
0
def password_reset_confirm(request, **kwargs):
    return django_password_reset_confirm(
        request,
        template_name='accounts/password_reset_confirm.html',
        post_reset_redirect=reverse('accounts:login'),
        **kwargs)