def get_student_list(coach, list_key): student_list = StudentList.get(list_key) if student_list is None: raise Exception("No list found with list_key='%s'." % list_key) if coach.key() not in student_list.coaches: raise Exception("Not your list!") return student_list
def get_list(coach, request_handler): list_id = request_handler.request_string('list_id') student_list = StudentList.get(list_id) if student_list is None: raise Exception("No list found with list_id='%s'." % list_id) if coach.key() not in student_list.coaches: raise Exception("Not your list!") return student_list
def get_list(coach, request_handler): list_id = request_handler.request_string("list_id") student_list = StudentList.get(list_id) if student_list is None: raise Exception("No list found with list_id='%s'." % list_id) if coach.key() not in student_list.coaches: raise Exception("Not your list!") return student_list
def remove_student_from_coach(student, coach): if student.student_lists: actual_lists = StudentList.get(student.student_lists) student.student_lists = [l.key() for l in actual_lists if coach.key() not in l.coaches] try: student.coaches.remove(coach.key_email) except ValueError: pass try: student.coaches.remove(coach.key_email.lower()) except ValueError: pass student.put()