def require_login(f):
    def decorated(request, **kwargs):
        if not request.is_logged_in:
            if request.is_xhr:
                return not_logged_in_json_response()
            request.flash(_(u'You have to login in order to visit this page.'))
            return redirect(url_for('core.login', next=request.url))
        return f(request, **kwargs)
    return update_wrapper(decorated, f)
Decorates a view function so that it requires a user that is
dataset/ETHPy150Open mitsuhiko/solace/solace/application.py/require_login