Cache le mot de passe de création de compte

This commit is contained in:
Martin Pépin 2016-07-18 20:40:08 +02:00
parent 6e875e4cb8
commit 150879dad8
2 changed files with 4 additions and 1 deletions

View file

@ -30,6 +30,7 @@ DEBUG = True
ALLOWED_HOSTS = ['*']
ACCOUNT_CREATION_PASS = ''
# Application definition

View file

@ -3,6 +3,7 @@ from django.contrib.auth.views import login as django_login_view
from django.contrib.auth.models import User
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.decorators import login_required
from django.conf import settings
from datetime import datetime
@ -21,7 +22,8 @@ def inscription_membre(request):
comp_form = InscriptionMembreForm(requbis)
if user_form.is_valid() and comp_form.is_valid():
pseudo = user_form.cleaned_data['username']
if not (comp_form.cleaned_data['validation'] == "Pouet-ta-mere"):
if not (comp_form.cleaned_data['validation']
== settings.ACCOUNT_CREATION_PASS):
error = "Le champ Validation ne correspond pas à celui attendu"
return render(request, "gestion/registration.html", locals())
member = user_form.save(commit=False)