taskapp/utilities/notification.py
changeset 156 7cad1e92713d
parent 153 925af1b4ee65
child 161 74ef330c9185
--- a/taskapp/utilities/notification.py	Mon Mar 01 02:09:00 2010 +0530
+++ b/taskapp/utilities/notification.py	Mon Mar 01 04:44:49 2010 +0530
@@ -52,6 +52,9 @@
 
     elif role == "MT":
 
+        notification.task = task
+        notification.sent_from = sent_from
+
         task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
         requested_mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
         new_mentor = sent_from
@@ -70,6 +73,8 @@
 
     elif role in ["DV", "MG", "AD"]:
 
+        notification.sent_from = sent_from
+
         accepting_user = sent_from
         user_url = '<a href="/user/view/uid=%s">%s</a>'%(accepting_user.id, accepting_user.username) ## i mean the user who has accepted it
         requested_by_url = '<a href="/user/view/uid=%s">%s</a>'%(requested_by.id, requested_by.username)
@@ -88,6 +93,7 @@
 
     elif role == "NT":
 
+        notification.task = task
         new_mentor = sent_to
         mentor_learn_url = '<sup><a href="/about/mentor">learn more</a></sup>'
         task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
@@ -110,6 +116,12 @@
         notification.message += "Happy Mentoring."
 
     elif role in ["CM", "CD"]:
+
+        notification.sent_from = sent_from
+        notification.role = role
+        notification.task = task
+        notification.remarks = remarks
+
         mentor = sent_from
         mentor_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
         task_url= '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)