[snowy] Do not crash if MODERATE_NEW_USERS is not set in the settings



commit ce08eedefcd23f72fc34fc2100f27afb9c8e32e2
Author: Leon Handreke <leon handreke gmail com>
Date:   Tue Oct 5 09:34:11 2010 -0700

    Do not crash if MODERATE_NEW_USERS is not set in the settings

 accounts/views.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/accounts/views.py b/accounts/views.py
index e2ba2c3..bbe8e4e 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -58,7 +58,7 @@ def openid_registration(request, template_name='registration/registration_form.h
             email = registration_form.cleaned_data.get('email')
             if email:
                 user.email = email
-            if settings.MODERATE_NEW_USERS:
+            if getattr(settings, 'MODERATE_NEW_USERS', False):
                 user.is_active = False
 
             user.save()
@@ -67,7 +67,7 @@ def openid_registration(request, template_name='registration/registration_form.h
                 login(request, user)
                 return HttpResponseRedirect(settings.LOGIN_REDIRECT_URL)
             else:
-                if not settings.MODERATE_NEW_USERS:
+                if not getattr(settings, 'MODERATE_NEW_USERS', False):
                     return HttpResponseNotAllowed(_(u'Disabled account'))
                 else:
                     return render_to_response("registration/moderated.html", {'user': user,},



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]