incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [28/50] [abbrv] git commit: [#2502] ticket:300 Suppress comment notifications during mass edit
Date Wed, 24 Apr 2013 04:54:33 GMT
[#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/tv/docs
Commit: 201cc53bd6c075f85f3494af11fc9259e169f05b
Parents: e802cce
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Apr 12 11:39:08 2013 +0000
Committer: Cory Johns <cjohns@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()


Mime
View raw message