You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/05/18 12:30:17 UTC
[2/3] allura git commit: [#7082] ticket:769 Filter out some stuff
from activity stream
[#7082] ticket:769 Filter out some stuff from activity stream
- Deleted artifacts
- Unmoderated and spam comments
- Comments on deleted artifacts
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/87f15d85
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/87f15d85
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/87f15d85
Branch: refs/heads/ib/7082
Commit: 87f15d85c597c7c9724ab9027a90b9ce7eac9295
Parents: ca9af9e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 18 08:45:04 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon May 18 08:45:04 2015 +0000
----------------------------------------------------------------------
Allura/allura/model/discuss.py | 4 +++-
Allura/allura/model/timeline.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/87f15d85/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 581eb21..406d447 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -522,12 +522,14 @@ class Post(Message, VersionedArtifact, ActivityObject):
not have access to a 'comment' activity unless he also has access to
the artifact on which it was posted (if there is one).
"""
- if self.project is None:
+ if self.project is None or self.deleted or self.status != 'ok':
return False
artifact_access = True
if self.thread.artifact:
if self.thread.artifact.project is None:
return False
+ if self.thread.artifact.deleted:
+ return False
artifact_access = security.has_access(self.thread.artifact, perm,
user, self.thread.artifact.project)
http://git-wip-us.apache.org/repos/asf/allura/blob/87f15d85/Allura/allura/model/timeline.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/timeline.py b/Allura/allura/model/timeline.py
index e9d9d99..d5b9af8 100644
--- a/Allura/allura/model/timeline.py
+++ b/Allura/allura/model/timeline.py
@@ -100,7 +100,7 @@ class ActivityObject(ActivityObjectBase):
"""Return True if user has perm access to this object, otherwise
return False.
"""
- if self.project is None:
+ if self.project is None or self.deleted:
return False
return security.has_access(self, perm, user, self.project)