aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-08-25 13:48:29 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-08-25 13:48:29 +0200
commit1a22cef1e411044719063a1f97ab1fdfbf064621 (patch)
treeb054aa2944d64e3b634f9f8dc66827df9084863d /pyaggr3g470r
parentIt is now possible to enable or disable self registration with an environment... (diff)
downloadnewspipe-1a22cef1e411044719063a1f97ab1fdfbf064621.tar.gz
newspipe-1a22cef1e411044719063a1f97ab1fdfbf064621.tar.bz2
newspipe-1a22cef1e411044719063a1f97ab1fdfbf064621.zip
Display a message when self registration is disabled.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r--pyaggr3g470r/views.py5
1 files changed, 4 insertions, 1 deletions
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()
bgstack15