Skip to content

Commit

Permalink
Do not crash if MODERATE_NEW_USERS is not set in the settings
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhandreke authored and Jeff Schroeder committed Oct 5, 2010
1 parent 0fe061d commit ce08eed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accounts/views.py
Expand Up @@ -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()
Expand All @@ -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,},
Expand Down

0 comments on commit ce08eed

Please sign in to comment.