From 1a22cef1e411044719063a1f97ab1fdfbf064621 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 25 Aug 2014 13:48:29 +0200 Subject: Display a message when self registration is disabled. --- pyaggr3g470r/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 57909e8a..2f8b5189 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -183,7 +183,10 @@ def signup(): """ Signup page. """ - if (g.user is not None and g.user.is_authenticated()) or not os.environ.get("SELF_REGISTRATION", False): + if not os.environ.get("SELF_REGISTRATION", False): + flash(gettext("Self registration is disabled."), 'info') + return redirect(url_for('home')) + if g.user is not None and g.user.is_authenticated(): return redirect(url_for('home')) form = SignupForm() -- cgit