zeeguu/api/api/teacher_dashboard/_only_teachers_decorator.py
def only_teachers(view):
    """
    Decorator checks that user is a teacher
    """

    @functools.wraps(view)
    def wrapped_view(*args, **kwargs):
        if not is_teacher(flask.g.user.id):
            flask.abort(401)
        return view(*args, **kwargs)

    return wrapped_view

    Decorator checks that user is a teacher
    
Decorator checks that user is a teacher
Decorator checks that user is a teacher
def only_teachers(view):
    @functools.wraps(view)
    def wrapped_view(*args, **kwargs):
        if not is_teacher(flask.g.user.id):
            flask.abort(401)
        return view(*args, **kwargs)
    return wrapped_view
def only_teachers ( view ) : @ functools . wraps ( view ) def wrapped_view ( * args , ** kwargs ) : if not is_teacher ( flask . g . user . id ) : flask . abort ( 401 ) return view ( * args , ** kwargs ) return wrapped_view
Decorator checks that user is a teacher
Decorator checks that user is a teacher
"""
    Decorator checks that user is a teacher
    """
view