changeset 1670:d3a1a3e7075f

items.NonExistent.do_show should always return 404 status code.
author Cheer Xiao <xiaqqaix@gmail.com>
date Sun, 12 Aug 2012 18:23:24 +0800
parents dfe5dd95eaeb
children c4b58c65830f c093039ac8a5
files MoinMoin/items/__init__.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sun Aug 12 20:17:33 2012 +0800
+++ b/MoinMoin/items/__init__.py	Sun Aug 12 18:23:24 2012 +0800
@@ -650,11 +650,13 @@
 
     def do_show(self, revid):
         # First, check if the current user has the required privileges
-        if not flaskg.user.may.create(self.name):
-            return render_template('show_nonexistent.html',
-                                   item_name=self.name,
-                                  )
-        return Response(self._select_itemtype(), 404)
+        if flaskg.user.may.create(self.name):
+            content = self._select_itemtype()
+        else:
+            content = render_template('show_nonexistent.html',
+                                      item_name=self.name,
+                                     )
+        return Response(content, 404)
 
     def do_modify(self):
         # First, check if the current user has the required privileges