allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: [#8061] attachments are only hidden on pending posts, not pending tickets (or anything else)
Date Fri, 11 Mar 2016 21:37:12 GMT
Repository: allura
Updated Branches:
  refs/heads/master d5d6d5152 -> 58fbe7ae4


[#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/58fbe7ae
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/58fbe7ae
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/58fbe7ae

Branch: refs/heads/master
Commit: 58fbe7ae47bcf85b5964b14ebf74580b3a775b45
Parents: d5d6d51
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Mar 7 13:53:40 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Fri Mar 11 16:20:55 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/58fbe7ae/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