Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the sensitive_post_parameters decorator to views. #1893

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mezzanine/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.debug import sensitive_post_parameters

from mezzanine.accounts import get_profile_form
from mezzanine.accounts.forms import LoginForm, PasswordResetForm
Expand All @@ -19,6 +20,7 @@
User = get_user_model()


@sensitive_post_parameters('password')
def login(request, template="accounts/account_login.html",
form_class=LoginForm, extra_context=None):
"""
Expand All @@ -44,6 +46,7 @@ def logout(request):
return redirect(next_url(request) or get_script_prefix())


@sensitive_post_parameters('password1', 'password2')
def signup(request, template="accounts/account_signup.html",
extra_context=None):
"""
Expand Down Expand Up @@ -120,6 +123,7 @@ def account_redirect(request):
return redirect("profile_update")


@sensitive_post_parameters('password1', 'password2')
@login_required
def profile_update(request, template="accounts/account_profile_update.html",
extra_context=None):
Expand Down