allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#8061] attachments are only hidden on pending posts, not pending tickets (or anything else)
Date Mon, 07 Mar 2016 18:53:55 GMT
Repository: allura
Updated Branches:
  refs/heads/db/8061 [created] 159a24c81


[#8061] attachments are only hidden on pending posts, not pending tickets (or anything else)


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

Branch: refs/heads/db/8061
Commit: 159a24c817d28d6f9692fc01dc2f95668e571caa
Parents: 672ac23
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Mar 7 13:53:40 2016 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Mar 7 13:53:40 2016 -0500

----------------------------------------------------------------------
 Allura/allura/controllers/attachments.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/159a24c8/Allura/allura/controllers/attachments.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/attachments.py b/Allura/allura/controllers/attachments.py
index 61c0bf2..1e089c3 100644
--- a/Allura/allura/controllers/attachments.py
+++ b/Allura/allura/controllers/attachments.py
@@ -23,6 +23,7 @@ from ming.utils import LazyProperty
 
 from allura.lib.security import require_access
 from allura.lib.utils import is_ajax
+from allura import model as M
 from .base import BaseController
 
 
@@ -60,9 +61,10 @@ class AttachmentController(BaseController):
 
     def _check_security(self):
         require_access(self.artifact, 'read')
-        status = getattr(self.artifact, 'status', None)
-        if status == 'pending':
-            require_access(self.artifact, 'moderate')
+        if isinstance(self.artifact, M.Post):
+            status = getattr(self.artifact, 'status', None)
+            if status == 'pending':
+                require_access(self.artifact, 'moderate')
 
     def __init__(self, filename, artifact):
         self.filename = filename


Mime
View raw message