🙈 Don't send any password to admins while registering

This commit is contained in:
Yohann D'ANELLO 2020-07-13 20:29:05 +02:00
parent dd62a32e08
commit c30a0cdf86
1 changed files with 10 additions and 0 deletions

View File

@ -8,8 +8,10 @@ from django.http import FileResponse, Http404
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
from django.views import View
from django.views.decorators.debug import sensitive_post_parameters
from django.views.generic import CreateView, UpdateView, DetailView, FormView
from django_tables2 import SingleTableView
from tournament.forms import TeamForm, JoinTeam
@ -29,6 +31,14 @@ class CreateUserView(CreateView):
form_class = SignUpForm
template_name = "registration/signup.html"
# When errors are reported from the signup view, don't send passwords to admins
@method_decorator(sensitive_post_parameters('password1', 'password2',))
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
def get_success_url(self):
return reverse_lazy('index')
class MyAccountView(LoginRequiredMixin, UpdateView):
"""