From 77312a19a2877e4650ebe55fc2fa596c968252ed Mon Sep 17 00:00:00 2001 From: nishanth Date: Mon, 1 Mar 2010 11:52:00 +0530 Subject: implemented nu nt nd ng na notifications. --- taskapp/utilities/notification.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'taskapp/utilities') diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py index 16e80a1..e16a94f 100644 --- a/taskapp/utilities/notification.py +++ b/taskapp/utilities/notification.py @@ -115,6 +115,33 @@ def create_notification(role, sent_to, sent_from=None, reply=None, task=None, re notification.message += "
" notification.message += "Happy Mentoring." + elif role == "NU": + + start_here_url = 'start here' + notification.sub = "Welcome %s"%sent_to.username + notification.message = "Welcome to PyTasks %s.
"%sent_to.username + notification.message += "If you are lost and have no clue, %s"%start_here_url + + elif role in ["ND", "NG", "NA"]: + + rights_dict = dict(RIGHTS_CHOICES) + + if role == "ND": + role_rights = rights_dict["DV"] + elif role == "NG": + role_rights = rights_dict["MG"] + elif role == "NA": + role_rights = rights_dict["AD"] + + requested_by_url = r'%s'%(requested_by.id, requested_by.username) + role_learn_url = r'click here'%role_rights.lower() + a_or_an = "an" if role_rights == "Admin" else "a" + + notification.sub = "You are now %s %s"%(a_or_an, role_rights) + notification.message = r"You have accepted the request made by %s asking you to act as %s %s in the site "%(requested_by_url, a_or_an, role_rights) + notification.message += "and you are now %s %s in the site.
%s to learn more on %s."%(a_or_an, role_rights, role_learn_url, role_rights) + + elif role in ["CM", "CD"]: notification.sent_from = sent_from -- cgit