You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/06/02 22:07:26 UTC
[35/39] 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/c00d9371
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c00d9371
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c00d9371
Branch: refs/heads/hs/7825
Commit: c00d937188d58b517968b5165f42177453a021ca
Parents: af239a6
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon May 18 08:45:04 2015 +0000
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Fri May 29 19:32:22 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/c00d9371/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index aa16255..326a140 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -526,12 +526,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/c00d9371/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)