#NEWLINE# def require_teacher( f ) : #NEWLINE# #INDENT# '\n    Wraps routing functions that require a user to be a teacher\n    ' #NEWLINE# @ require_login #NEWLINE# @ wraps ( f ) #NEWLINE# def wrapper( * args , **kwds ) : #NEWLINE# #INDENT# if ( ( not api . user . is_teacher ( ) ) or ( not api . config . enable_teachers ) ) : #NEWLINE# #INDENT# raise WebException ( 'You must be a teacher!' ) #NEWLINE# #UNINDENT# return f ( * args , ** kwds ) #NEWLINE# #UNINDENT# return f