Add a warning to the user that registrations are disabled.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Jul 2011 14:02:17 +0000 (09:02 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Jul 2011 14:02:17 +0000 (09:02 -0500)
mediagoblin/auth/views.py

index 01bfc0662ae203051fe17252e22d3e48be1a41f4..7facc1bfdb1141b32ec5c2b290a1751843466744 100644 (file)
@@ -31,9 +31,12 @@ def register(request):
     """
     Your classic registration view!
     """
-
     # Redirects to indexpage if registrations are disabled
     if not mg_globals.app_config["allow_registration"]:
+        messages.add_message(
+            request,
+            messages.WARNING,
+            ('Sorry, registration is disabled on this instance.'))
         return redirect(request, "index")
 
     register_form = auth_forms.RegistrationForm(request.POST)