From 150879dad8e42590af8b5364f764cff5a8d85bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 18 Jul 2016 20:40:08 +0200 Subject: [PATCH] =?UTF-8?q?Cache=20le=20mot=20de=20passe=20de=20cr=C3=A9at?= =?UTF-8?q?ion=20de=20compte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ernestophone/settings-example.py | 1 + gestion/views.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Ernestophone/settings-example.py b/Ernestophone/settings-example.py index fae7656..c6c9924 100644 --- a/Ernestophone/settings-example.py +++ b/Ernestophone/settings-example.py @@ -30,6 +30,7 @@ DEBUG = True ALLOWED_HOSTS = ['*'] +ACCOUNT_CREATION_PASS = '' # Application definition diff --git a/gestion/views.py b/gestion/views.py index 3acdcfe..9e4efe6 100644 --- a/gestion/views.py +++ b/gestion/views.py @@ -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)