diff options
author | nishanth | 2010-02-26 00:17:54 +0530 |
---|---|---|
committer | nishanth | 2010-02-26 00:17:54 +0530 |
commit | 8c5ecbc4780ca1f0b929cca534a9b63dcba967fd (patch) | |
tree | dbb08a93d52be855ffecf1dc70ab51ea35bf377d /taskapp/events | |
parent | d7a7222bb20f85cf730e7c7f1f8350ccf43066f6 (diff) | |
download | pytask-8c5ecbc4780ca1f0b929cca534a9b63dcba967fd.tar.gz pytask-8c5ecbc4780ca1f0b929cca534a9b63dcba967fd.tar.bz2 pytask-8c5ecbc4780ca1f0b929cca534a9b63dcba967fd.zip |
now adding mentor for a task happens through request. notifications still pending though
Diffstat (limited to 'taskapp/events')
-rw-r--r-- | taskapp/events/request.py | 10 | ||||
-rw-r--r-- | taskapp/events/task.py | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/taskapp/events/request.py b/taskapp/events/request.py index aa38fc8..73ba5f9 100644 --- a/taskapp/events/request.py +++ b/taskapp/events/request.py @@ -1,5 +1,5 @@ from datetime import datetime -from pytask.taskapp.events.task import addCredits +from pytask.taskapp.events.task import addCredits, addMentor def reply_to_request(request_obj, reply, replied_by): """ @@ -24,7 +24,13 @@ def reply_to_request(request_obj, reply, replied_by): print "send a no notificvaton" elif request_obj.role == "MT": ## add him as a mentor to the task - pass + if reply: + addMentor(request_obj.task, request_obj.replied_by) + ## pass on notification of request_obj.sent_by + else: + print "request for mentor rejected" + ## pass on notification to request_obj.sent_by + elif request_obj.role in ["AD", "MG", "DV"]: if reply: pass diff --git a/taskapp/events/task.py b/taskapp/events/task.py index a3ae263..323c8cf 100644 --- a/taskapp/events/task.py +++ b/taskapp/events/task.py @@ -75,6 +75,12 @@ def addDep(main_task, dependency): main_task.save() +def reqMentor(task, mentor, req_by): + """ create a request object with role as MT. + """ + + create_request(sent_by=req_by, role="MT", sent_to=mentor, task=task) + def addMentor(task,mentor): """ add the mentor to mentors list of the task """ |