def login_if_not_authenticated(function):

    def wrap(controller, request, *args, **kwargs):
        if ((not request.user) or (not request.user.is_authenticated)):
            return redirect(((reverse('app.web.login') + '?redirect=') + request.get_full_path()))
        return function(controller, request, *args, **kwargs)
    return wrap
def login_if_not_authenticated(function):

    def wrap(controller, request, *args, **kwargs):
        if ((not request.user) or (not request.user.is_authenticated)):
            return redirect(((reverse('app.web.login') + '?redirect=') + request.get_full_path()))
        return function(controller, request, *args, **kwargs)
    return wrap