(f)
return _wrapped
A decorator for views which required a logged in user.
A decorator for views which required a logged in user.
A decorator for views which required a logged in user .
def user_required(f):
    """
    A decorator for views which required a logged in user.
    """
    @wraps(f)
    def _wrapped(*args, **kwargs):
        if g.user is None:
            return redirect(url_for('account.login'))
        return f(*args, **kwargs)
    return _wrapped
def user_required ( f ) : @ wraps ( f ) def _wrapped ( * args , * * kwargs ) : if g . user is None : return redirect ( url_for ( 'account.login' ) ) return f ( * args , * * kwargs ) return _wrapped