25 receiving_user = request_obj.receiving_user |
25 receiving_user = request_obj.receiving_user |
26 requested_by = request_obj.sent_by |
26 requested_by = request_obj.sent_by |
27 for a_mentor in task.mentors.all(): |
27 for a_mentor in task.mentors.all(): |
28 if reply: |
28 if reply: |
29 addCredits(task, request_obj.sent_by, request_obj.receiving_user, pynts) |
29 addCredits(task, request_obj.sent_by, request_obj.receiving_user, pynts) |
30 print "send yes notifications appropriately" |
30 create_notification(request_obj.role, a_mentor, replied_by, True, task, receiving_user, pynts, requested_by) |
31 #def create_notification(role, sent_to, sent_from=None, reply=None, task=None, remark=None, receiving_user=None, pynts=None, requested_by): |
|
32 create_notification("PY", a_mentor, replied_by, True, task, receiving_user, pynts, requested_by) |
|
33 else: |
31 else: |
34 print "send a no notificvaton" |
32 create_notification(request_obj.role, a_mentor, replied_by, False, task, receiving_user, pynts, requested_by, request_obj.remarks) |
35 create_notification("PY", a_mentor, replied_by, False, task, receiving_user, pynts, requested_by, request_obj.remarks) |
|
36 |
33 |
37 elif request_obj.role == "MT": |
34 elif request_obj.role == "MT": |
38 ## add him as a mentor to the task |
35 ## add him as a mentor to the task |
39 if reply: |
36 if reply: |
40 ## check for the current rights of request_obj.sent_by |
37 ## check for the current rights of request_obj.sent_by |