Changeset - 32a283e5fd0d
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-01-29 22:40:29
marcin@python-works.com
Don't send notification email for auto-status changes
2 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/changeset_status.py
Show inline comments
 
@@ -132,10 +132,11 @@ class ChangesetStatusModel(BaseModel):
 
        if not comment:
 
            from rhodecode.model.comment import ChangesetCommentsModel
 
            comment = ChangesetCommentsModel().create(
 
                text='Auto status change',
 
                text='Auto status change to %s' % status,
 
                repo=repo,
 
                user=user,
 
                pull_request=pull_request,
 
                send_email=False
 
            )
 
        if revision:
 
            q = q.filter(ChangesetStatus.repo == repo)
rhodecode/model/comment.py
Show inline comments
 
@@ -58,7 +58,7 @@ class ChangesetCommentsModel(BaseModel):
 
        return user_objects
 

	
 
    def create(self, text, repo, user, revision=None, pull_request=None,
 
               f_path=None, line_no=None, status_change=None):
 
               f_path=None, line_no=None, status_change=None, send_email=True):
 
        """
 
        Creates new comment for changeset or pull request.
 
        IF status_change is not none this comment is associated with a
 
@@ -72,6 +72,7 @@ class ChangesetCommentsModel(BaseModel):
 
        :param f_path:
 
        :param line_no:
 
        :param status_change:
 
        :param send_email:
 
        """
 
        if not text:
 
            return
 
@@ -164,6 +165,8 @@ class ChangesetCommentsModel(BaseModel):
 
                                   repo_name=pull_request.other_repo.repo_name,
 
                                   qualified=True)
 
            }
 

	
 
        if send_email:
 
        # create notification objects, and emails
 
        NotificationModel().create(
 
            created_by=user, subject=subj, body=body,
0 comments (0 inline, 0 general)