def _wrapper(request, *args, **kw): if request.user: util.notice(request, 'You are already logged in') raise exception.LogoutRequiredException() return handler(request, *args, **kw)
def _wrapper(request, *args, **kw): if not request.user: util.notice(request, 'Please login') raise exception.LoginRequiredException() return handler(request, *args, **kw)