diff MoinMoin/items/__init__.py @ 1005:c36f61f85e97

AccessDeniedError replaced by AccessDenied, from the new storage api.
author Bruno Martin <bruno@hacklab.com.br>
date Sat, 29 Oct 2011 02:14:29 -0200
parents 9fd0a6a988bb
children 80043704f37e
line wrap: on
line diff
--- a/MoinMoin/items/__init__.py	Sat Oct 29 01:43:06 2011 -0200
+++ b/MoinMoin/items/__init__.py	Sat Oct 29 02:14:29 2011 -0200
@@ -37,6 +37,7 @@
 from MoinMoin.util.tree import moin_page, html, xlink, docbook
 from MoinMoin.util.iri import Iri
 from MoinMoin.util.crypto import cache_key
+from MoinMoin.storage.middleware.protecting import AccessDenied
 
 try:
     import PIL
@@ -66,8 +67,7 @@
 from MoinMoin import wikiutil, config, user
 from MoinMoin.util.send_file import send_file
 from MoinMoin.util.interwiki import url_for_item
-from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError, AccessDeniedError, \
-                                   StorageError
+from MoinMoin.storage.error import NoSuchItemError, NoSuchRevisionError, StorageError
 from MoinMoin.config import NAME, NAME_OLD, NAME_EXACT, WIKINAME, MTIME, REVERTED_TO, ACL, \
                             IS_SYSITEM, SYSITEM_VERSION,  USERGROUP, SOMEDICT, \
                             CONTENTTYPE, SIZE, LANGUAGE, ITEMLINKS, ITEMTRANSCLUSIONS, \
@@ -711,7 +711,7 @@
             if form.validate():
                 try:
                     self.modify() # XXX
-                except AccessDeniedError:
+                except AccessDenied:
                     abort(403)
                 else:
                     return redirect(url_for_item(self.name))
@@ -1166,7 +1166,7 @@
             if form.validate():
                 try:
                     self.modify() # XXX
-                except AccessDeniedError:
+                except AccessDenied:
                     abort(403)
                 else:
                     return redirect(url_for_item(self.name))
@@ -1324,7 +1324,7 @@
             # this POST comes directly from TWikiDraw (not from Browser), thus no validation
             try:
                 self.modify() # XXX
-            except AccessDeniedError:
+            except AccessDenied:
                 abort(403)
             else:
                 # TWikiDraw POSTs more than once, redirecting would break them
@@ -1414,7 +1414,7 @@
             # this POST comes directly from AnyWikiDraw (not from Browser), thus no validation
             try:
                 self.modify() # XXX
-            except AccessDeniedError:
+            except AccessDenied:
                 abort(403)
             else:
                 # AnyWikiDraw POSTs more than once, redirecting would break them
@@ -1500,7 +1500,7 @@
             # this POST comes directly from SvgDraw (not from Browser), thus no validation
             try:
                 self.modify() # XXX
-            except AccessDeniedError:
+            except AccessDenied:
                 abort(403)
             else:
                 # SvgDraw POSTs more than once, redirecting would break them