modified get_user method to give only count of unread requests.
authornishanth
Sun, 28 Feb 2010 14:58:11 +0530
changeset 144 581ad20b8c39
parent 143 796ff9e279a8
child 145 0c97a02b9bdb
modified get_user method to give only count of unread requests.
taskapp/utilities/notification.py
taskapp/utilities/user.py
--- a/taskapp/utilities/notification.py	Sun Feb 28 14:44:10 2010 +0530
+++ b/taskapp/utilities/notification.py	Sun Feb 28 14:58:11 2010 +0530
@@ -63,7 +63,7 @@
             notification.message += "He can be contacted on %s"%new_mentor.email
 
         else:
-            notification.sub = "Rejected request to act as a mentor for %s"%task.title[:20]
+            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.<br />"%(new_mentor_url, task_url)
             if remarks:
                 notification.message += "Remarks: %s<br />"%remarks
--- a/taskapp/utilities/user.py	Sun Feb 28 14:44:10 2010 +0530
+++ b/taskapp/utilities/user.py	Sun Feb 28 14:58:11 2010 +0530
@@ -7,7 +7,7 @@
     """
 
     unread_notifications = user.notification_sent_to.filter(is_read=False,is_deleted=False)
-    unread_requests = user.request_sent_to.filter(is_valid=True,is_replied=False)
+    unread_requests = user.request_sent_to.filter(is_valid=True,is_replied=False,is_read=False)
 
     user.unread_notifications = unread_notifications
     user.unread_requests = unread_requests