def dispatch(self, request, *args, **kwargs):
# Let logged in super users continue
if not request.user.is_anonymous() and not request.user.is_superuser:
return redirect('wiki:root')
# If account handling is disabled, don't go here
if not settings.ACCOUNT_HANDLING:
return redirect(settings.SIGNUP_URL)
# Allow superusers to use signup page...
if not request.user.is_superuser and not settings.ACCOUNT_SIGNUP_ALLOWED:
c = RequestContext(
request, {
'error_msg': _('Account signup is only allowed for administrators.'), })
return render_to_response("wiki/error.html", context=c)
return super(Signup, self).dispatch(request, *args, **kwargs)
评论列表
文章目录