diff options
author | nishanth | 2010-02-28 22:49:05 +0530 |
---|---|---|
committer | nishanth | 2010-02-28 22:49:05 +0530 |
commit | 2e78ea670355735b7a717dcfd87f1690cacf6ef6 (patch) | |
tree | 95456e7d23f862a2748dc5bb130bcaaa8733aa22 /taskapp/utilities/notification.py | |
parent | 32a2753b002516357f6504a76d28851f0cc94829 (diff) | |
download | pytask-2e78ea670355735b7a717dcfd87f1690cacf6ef6.tar.gz pytask-2e78ea670355735b7a717dcfd87f1690cacf6ef6.tar.bz2 pytask-2e78ea670355735b7a717dcfd87f1690cacf6ef6.zip |
ditchaxed credit model.
Diffstat (limited to 'taskapp/utilities/notification.py')
-rw-r--r-- | taskapp/utilities/notification.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py index afa0faa..75c35db 100644 --- a/taskapp/utilities/notification.py +++ b/taskapp/utilities/notification.py @@ -102,13 +102,30 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re working_users = task.assigned_users.all() if working_users: - notification_message += "List of users working on the task.<br />" - notification_message += "<ul>" + notification.message += "List of users working on the task.<br />" + notification.message += "<ul>" for a_user in working_users: notification.message += "<li> %s - %s </li>"%(a_user.username, a_user.email) notification.message += "</ul><br />" notification.message += "Happy Mentoring." + elif role in ["CM", "CD"]: + 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) + + if role == "CM": + notification.sub = "%s has been marked complete"%task.title + notification.message = "The task %s has been marked complete by %s.<br />"%(task_url, mentor_url) + + elif role == "CD": + notification.sub = "%s has been closed"%task.title + notification.message = "The task %s has been closed by %s.<br />"%(task_url, mentor_url) + + if remarks: + notification.message += "<b>Remarks:</b> %s"%remarks + + notification.save() def mark_notification_read(notification_id): |