diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-09 08:58:22 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-09 08:58:22 -0500 |
commit | d41cc42a66dd6f8e9db126b9724bde62b7c6f3a8 (patch) | |
tree | c305d8331e672daa0d36d536592cf56d3e9ff8d1 /mediagoblin/auth/views.py | |
parent | eedc5428fd4fa775405084c74baa186d9c41efda (diff) | |
parent | 5647d641a27b1ebd9f9de4c8b6c452d80be0f4a2 (diff) | |
download | mediagoblin-d41cc42a66dd6f8e9db126b9724bde62b7c6f3a8.tar.lz mediagoblin-d41cc42a66dd6f8e9db126b9724bde62b7c6f3a8.tar.xz mediagoblin-d41cc42a66dd6f8e9db126b9724bde62b7c6f3a8.zip |
Merge remote branch 'remotes/amusablelemur/feature374'
Diffstat (limited to 'mediagoblin/auth/views.py')
-rw-r--r-- | mediagoblin/auth/views.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 2450023f..01bfc066 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -19,6 +19,7 @@ import uuid from webob import exc from mediagoblin import messages +from mediagoblin import mg_globals from mediagoblin.util import render_to_response, redirect from mediagoblin.db.util import ObjectId from mediagoblin.auth import lib as auth_lib @@ -30,6 +31,11 @@ def register(request): """ Your classic registration view! """ + + # Redirects to indexpage if registrations are disabled + if not mg_globals.app_config["allow_registration"]: + return redirect(request, "index") + register_form = auth_forms.RegistrationForm(request.POST) if request.method == 'POST' and register_form.validate(): @@ -98,7 +104,8 @@ def login(request): 'mediagoblin/auth/login.html', {'login_form': login_form, 'next': request.GET.get('next') or request.POST.get('next'), - 'login_failed': login_failed}) + 'login_failed': login_failed, + 'allow_registration': mg_globals.app_config["allow_registration"]}) def logout(request): |