added: when user is removed from course he is also removed from projects inside course #126

Това подаване се съдържа в:
Aran Zaiger 2015-08-01 17:17:53 +03:00
родител 4b08085d63
подаване ad3b232f5d

Преглед на файла

@ -646,6 +646,13 @@ def removeUserFromCourse(token, userId, courseId):
except Exception as e:
return bad_request("user is not listed to this course")
#remove user from all projects in course
projects = Project.all().filter("courseId =", course.key().id())
for p in projects:
if p.key().id() in userToRemove.projects_id_list:
userToRemove.projects_id_list.remove(p.key().id())
p.membersId.remove(userToRemove.key().id())
db.put(p)
db.put(userToRemove)