diff rhodecode/model/comment.py @ 2296:e5c0f201ca0b codereview

Add changeset status change into emails
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 17 May 2012 12:54:44 +0200
parents b61e540122f2
children 91fae60bf2b6
line wrap: on
line diff
--- a/rhodecode/model/comment.py	Thu May 17 00:47:45 2012 +0200
+++ b/rhodecode/model/comment.py	Thu May 17 12:54:44 2012 +0200
@@ -52,9 +52,10 @@
         return user_objects
 
     def create(self, text, repo_id, user_id, revision, f_path=None,
-               line_no=None):
+               line_no=None, status_change=None):
         """
-        Creates new comment for changeset
+        Creates new comment for changeset. IF status_change is not none
+        this comment is associated with a status change of changeset
 
         :param text:
         :param repo_id:
@@ -62,6 +63,7 @@
         :param revision:
         :param f_path:
         :param line_no:
+        :param status_change:
         """
 
         if text:
@@ -104,7 +106,8 @@
 
             NotificationModel().create(
               created_by=user_id, subject=subj, body=body,
-              recipients=recipients, type_=Notification.TYPE_CHANGESET_COMMENT
+              recipients=recipients, type_=Notification.TYPE_CHANGESET_COMMENT,
+              email_kwargs={'status_change': status_change}
             )
 
             mention_recipients = set(self._extract_mentions(body))\