taskapp/utilities/notification.py
changeset 199 946d0fe60606
parent 186 c083ebb6f8d7
child 201 c429873d8ac8
equal deleted inserted replaced
196:2759d422ad89 199:946d0fe60606
   220 
   220 
   221         if remarks:
   221         if remarks:
   222             notification.remarks = remarks
   222             notification.remarks = remarks
   223             notification.message += "<b>Reason: </b>%s"%remarks
   223             notification.message += "<b>Reason: </b>%s"%remarks
   224 
   224 
       
   225     elif role == "CL":
       
   226 
       
   227         notification.sent_from = sent_from
       
   228         notification.task = task
       
   229         notification.remarks = remarks
       
   230 
       
   231         claimed_by_url = '<a href="/user/view/uid=%s">%s</a>'%(sent_from.id, sent_from.username)
       
   232         task_url = '<a href="/task/view/tid=%s">%s</a>'%(task.id, task.title)
       
   233 
       
   234         notification.sub = 'New claim for the task "%s"'%(task.title[:20])
       
   235         notification.message = '%s has submitted a claim for the task "%s" mentored by you.<br />'%(claimed_by_url, task_url)
       
   236         notification.message += '<b>Claim proposal:</b> %s'%(remarks)
       
   237 
       
   238 
       
   239 
   225     notification.save()
   240     notification.save()
   226 
   241 
   227 def mark_notification_read(notification_id):
   242 def mark_notification_read(notification_id):
   228     """
   243     """
   229     makes a notification identified by the notification_id read.
   244     makes a notification identified by the notification_id read.