From 1d1cd491495ff976db93b3de82f1feecdcc14dff Mon Sep 17 00:00:00 2001
From: nishanth
Date: Mon, 1 Mar 2010 12:44:27 +0530
Subject: added au ru notifications.
---
taskapp/utilities/notification.py | 45 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
(limited to 'taskapp/utilities')
diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py
index e16a94f..887b82e 100644
--- a/taskapp/utilities/notification.py
+++ b/taskapp/utilities/notification.py
@@ -69,12 +69,12 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
notification.sub = "%s rejected request to act as a mentor"%new_mentor.username
notification.message = "%s has rejected your request asking him to act as a mentor for %s.
"%(new_mentor_url, task_url)
if remarks:
+ notification.remarks = remarks
notification.message += "Remarks: %s
"%remarks
elif role in ["DV", "MG", "AD"]:
notification.sent_from = sent_from
-
accepting_user = sent_from
user_url = '%s'%(accepting_user.id, accepting_user.username) ## i mean the user who has accepted it
requested_by_url = '%s'%(requested_by.id, requested_by.username)
@@ -89,6 +89,7 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
notification.sub = "Rejected your request to act as %s"%role_rights
notification.message = "%s has rejected your request asking him to act as %s %s.
"%(user_url, a_or_an, role_rights)
if remarks:
+ notification.remarks = remarks
notification.message += "Remarks: %s
"%remarks
elif role == "NT":
@@ -162,8 +163,50 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
notification.message = "The task %s has been closed by %s.
"%(task_url, mentor_url)
if remarks:
+ notification.remarks = remarks
notification.message += "Remarks: %s"%remarks
+ elif role == "AU":
+
+ notification.task = task
+ added_user = sent_to
+ mentor = sent_from
+ assigned_by_url = '%s'%(mentor.id, mentor.username)
+ task_url= '%s'%(task.id, task.title)
+
+ notification.sub = "Your claim for the task %s accepted."%task.title[:20]
+ notification.message = "You have been selected to work on the task %s by %s.
"%(task_url, assigned_by_url)
+ notification.message += "You can now start working on the task and will be credited by the mentors for your work.
"
+
+ notification.message += " Here is a list of mentors for the task and their email addresses.