added chrone job
This commit is contained in:
parent
71939c1b1c
commit
482e6daf09
2 changed files with 34 additions and 2 deletions
|
@ -377,10 +377,10 @@ def deleteProject(token,projectId):
|
||||||
|
|
||||||
#remove all users related to project
|
#remove all users related to project
|
||||||
for uId in p.membersId:
|
for uId in p.membersId:
|
||||||
user = User.get_by_id(uId)
|
user = User.get_by_id(int(uId))
|
||||||
if user is None:
|
if user is None:
|
||||||
return bad_request("trying to remove a user from project failed")
|
return bad_request("trying to remove a user from project failed")
|
||||||
user.projects_id_list.remove(p.key().id())
|
user.projects_id_list.remove(str(p.key().id()))
|
||||||
db.put(user)
|
db.put(user)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -866,6 +866,38 @@ def documentation():
|
||||||
return auto.html()
|
return auto.html()
|
||||||
|
|
||||||
|
|
||||||
|
@task_routes.route('/api/tasks/sendTaskReminder', methods=['GET'])
|
||||||
|
def sendTaskReminder():
|
||||||
|
|
||||||
|
tasks = Task.all()
|
||||||
|
|
||||||
|
#go over all the courses
|
||||||
|
for t in tasks.run():
|
||||||
|
if t.dueDate == datetime.date.today() + datetime.timedelta(days=1):
|
||||||
|
course = Course.get_by_id(int(t.courseId))
|
||||||
|
if t.isPersonal:
|
||||||
|
for uId in course.membersId:
|
||||||
|
tc = TaskComponent.all().filter("taskId = ", t.key().id()).filter("userId = ", int(uId))
|
||||||
|
if tc.count() == 0:
|
||||||
|
#SEND MAIL!! TODO
|
||||||
|
print ""
|
||||||
|
|
||||||
|
else:
|
||||||
|
projects = Project.all().filter("courseId = ", course.key().id())
|
||||||
|
for p in projects:
|
||||||
|
tc = TaskComponent.all().filter("taskId = ", t.key().id()).filter("userId = ", p.key().id())
|
||||||
|
if tc.count() == 0:
|
||||||
|
#SEND MAIL!! TODO
|
||||||
|
print ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#go over all
|
||||||
|
|
||||||
|
return accepted("Task deleted")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue