# HG changeset patch # User nishanth # Date 1267703940 -19800 # Node ID 946d0fe6060654bca858b94afcc472fedcb03d66 # Parent 2759d422ad8963368c8a0585c91af3c92fb363b5 now a notification is sent to all the mentors after there is a new claim. diff -r 2759d422ad89 -r 946d0fe60606 taskapp/events/task.py --- a/taskapp/events/task.py Thu Mar 04 15:31:40 2010 +0530 +++ b/taskapp/events/task.py Thu Mar 04 17:29:00 2010 +0530 @@ -155,6 +155,9 @@ user_url = '%s'%(user.id, user.username) reason = "User has claimed the task and hence cannot be a mentor and this request was made invalid." create_notification("MT", req.sent_by, user, task=task, reply=False, remarks=reason, requested_by=req.sent_by) + + for a_mentor in task.mentors.all(): + create_notification("CL", a_mentor, user, task=task, remarks=message) def assignTask(task, added_user, assigned_by): """ check for the status of task and assign it to the particular user """ diff -r 2759d422ad89 -r 946d0fe60606 taskapp/utilities/notification.py --- a/taskapp/utilities/notification.py Thu Mar 04 15:31:40 2010 +0530 +++ b/taskapp/utilities/notification.py Thu Mar 04 17:29:00 2010 +0530 @@ -222,6 +222,21 @@ notification.remarks = remarks notification.message += "Reason: %s"%remarks + elif role == "CL": + + notification.sent_from = sent_from + notification.task = task + notification.remarks = remarks + + claimed_by_url = '%s'%(sent_from.id, sent_from.username) + task_url = '%s'%(task.id, task.title) + + notification.sub = 'New claim for the task "%s"'%(task.title[:20]) + notification.message = '%s has submitted a claim for the task "%s" mentored by you.
'%(claimed_by_url, task_url) + notification.message += 'Claim proposal: %s'%(remarks) + + + notification.save() def mark_notification_read(notification_id):