summaryrefslogtreecommitdiff
path: root/taskapp/utilities
diff options
context:
space:
mode:
authornishanth2010-03-02 03:21:20 +0530
committernishanth2010-03-02 03:21:20 +0530
commit26c34400dcbf963086e3cc5d812dc7f1333d5cc5 (patch)
treeb08ed2707efb73e54f073180a894e0814deaef1a /taskapp/utilities
parentc96afacd4dd27cbf092eb398862ac9dc120e9309 (diff)
downloadpytask-26c34400dcbf963086e3cc5d812dc7f1333d5cc5.tar.gz
pytask-26c34400dcbf963086e3cc5d812dc7f1333d5cc5.tar.bz2
pytask-26c34400dcbf963086e3cc5d812dc7f1333d5cc5.zip
implemented deleting of a task.
Diffstat (limited to 'taskapp/utilities')
-rw-r--r--taskapp/utilities/notification.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py
index 887b82e..b79d091 100644
--- a/taskapp/utilities/notification.py
+++ b/taskapp/utilities/notification.py
@@ -169,6 +169,7 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
elif role == "AU":
notification.task = task
+ notification.sent_from = sent_from
added_user = sent_to
mentor = sent_from
assigned_by_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
@@ -194,6 +195,7 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
elif role == "RU":
notification.task = task
+ notification.sent_from = sent_from
removed_user = sent_to
mentor = sent_from
removed_by_url = '<a href="/user/view/uid=%s">%s</a>'%(mentor.id, mentor.username)
@@ -207,6 +209,18 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re
notification.remarks = remarks
notification.message += "<b>Reason: </b>%s"%(remarks)
+ elif role == "DL":
+
+ notification.sent_from = sent_from
+ notification.task = task
+ deleted_by_url = '<a href="/user/view/uid=%s">%s</a>'%(sent_from.id, sent_from.username)
+
+ notification.sub = "Task deleted"
+ notification.message = 'The unpublished task "%s" viewable by you has been deleted by its creator %s.<br />'%(task.title, deleted_by_url)
+
+ if remarks:
+ notification.remarks = remarks
+ notification.message += "<b>Reason: </b>%s"%remarks
notification.save()