From 62ac12deffa0d100885769f7199b80633c1ff51b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 25 Oct 2016 18:06:55 +0200 Subject: [PATCH] Some more simplification --- pillar/web/nodes/custom/posts.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pillar/web/nodes/custom/posts.py b/pillar/web/nodes/custom/posts.py index 8e6cfa34..1b0845d9 100644 --- a/pillar/web/nodes/custom/posts.py +++ b/pillar/web/nodes/custom/posts.py @@ -50,10 +50,7 @@ def posts_view(project_id=None, project_url=None, url=None): # If post is not published, check that the user is also the author of # the post. If not, return 404. if post.properties.status != "published": - if current_user.is_authenticated: - if not post.has_method('PUT'): - abort(403) - else: + if not (current_user.is_authenticated and post.has_method('PUT')): abort(403) return render_template(