You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/04/23 18:42:47 UTC

[43/50] [abbrv] git commit: [#2502] ticket:300 Suppress comment notifications during mass edit

[#2502] ticket:300 Suppress comment notifications during mass edit


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/201cc53b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/201cc53b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/201cc53b

Branch: refs/heads/cj/5120
Commit: 201cc53bd6c075f85f3494af11fc9259e169f05b
Parents: e802cce
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Apr 12 11:39:08 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Apr 22 19:40:27 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py            |    7 ++++---
 ForgeTracker/forgetracker/tracker_main.py |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/201cc53b/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index a59437b..76a9aa1 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -257,7 +257,7 @@ class Thread(Artifact, ActivityObject):
         if ignore_security or has_access(self, 'unmoderated_post')():
             log.info('Auto-approving message from %s', c.user.username)
             file_info = kw.get('file_info', None)
-            post.approve(file_info)
+            post.approve(file_info, notify=kw.get('notify', True))
         else:
             self.notify_moderators(post)
         return post
@@ -582,7 +582,7 @@ class Post(Message, VersionedArtifact, ActivityObject):
         super(Post, self).delete()
         self.thread.num_replies = max(0, self.thread.num_replies - 1)
 
-    def approve(self, file_info=None):
+    def approve(self, file_info=None, notify=True):
         if self.status == 'ok':
             return
         self.status = 'ok'
@@ -594,7 +594,8 @@ class Post(Message, VersionedArtifact, ActivityObject):
             and author._id != None):
             security.simple_grant(
                 self.acl, author.project_role()._id, 'unmoderated_post')
-        self.notify(file_info=file_info)
+        if notify:
+            self.notify(file_info=file_info)
         artifact = self.thread.artifact or self.thread
         session(self).flush()
         self.thread.last_post_date = max(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/201cc53b/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index bb0fe7b..28c73ac 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -838,7 +838,7 @@ class RootController(BaseController):
                     new_value,
                     old_value)
             if message != '':
-                ticket.discussion_thread.post(message)
+                ticket.discussion_thread.post(message, notify=False)
                 ticket.commit()
         c.app.globals.invalidate_bin_counts()
         ThreadLocalORMSession.flush_all()