accounts.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:website 作者: hackerspace-ntnu 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号