@auth_decorator
def admin_only(self):
 user = self.get_current_user()
 if ((user is None) or (not user.admin)):
  raise web.HTTPError(403)

@ auth_decorator def admin_only ( self ) : user = self . get_current_user ( ) if ( ( user is None ) or ( not user . admin ) ) : raise web . HTTPError ( 403 )
decorator for restricting access to admin users .