Skip to content
Browse files

Do not crash if MODERATE_NEW_USERS is not set in the settings

  • Loading branch information...
1 parent 0fe061d commit ce08eedefcd23f72fc34fc2100f27afb9c8e32e2 @leonhandreke leonhandreke committed with Jeff Schroeder Oct 5, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 accounts/views.py
View
4 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,},

0 comments on commit ce08eed

Please sign in to comment.
Something went wrong with that request. Please try again.