def remove_user(user, school): """ Removes a user from a school's committee """ print "Loading DAN - committee for %s:" % school if school is None: school = current_app.config['DEFAULT_SCHOOL'] s = load_school(school) u = find_user(user) if u: remove_user_from_dan(u, load_dan(s)) print " - removed from committee: %s" % user else: print " - no user exists with email or username: %s" % user
def add_user(user, school): """ Adds a user to a school's committee """ print "Loading DAN - committee for %s:" % school if school is None: school = current_app.config['DEFAULT_SCHOOL'] s = load_school(school) u = find_user(user) if u: add_user_to_dan(u, load_dan(s)) print " - added to committee: %s" % user else: print " - no user exists with email or username: %s" % user