From d75fe70228c89e3606e51a4d5775faf549252a90 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 30 Sep 2009 03:27:28 +0000 Subject: - The import of ``repoze.bfg.view.NotFound`` is deprecated in favor of ``repoze.bfg.exceptions.NotFound``. The old location still functions, but emits a deprecation warning. - The import of ``repoze.bfg.security.Unauthorized`` is deprecated in favor of ``repoze.bfg.exceptions.Forbidden``. The old location still functions but emits a deprecation warning. The rename from ``Unauthorized`` to ``Forbidden`` brings parity to the the name of the exception and the system view it invokes when raised. - New ``repoze.bfg.exceptions`` module was created to house exceptions that were previously sprinkled through various modules. - An ``exceptions`` API chapter was added, documenting the new ``repoze.bfg.exceptions`` module. --- repoze/bfg/testing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'repoze/bfg/testing.py') diff --git a/repoze/bfg/testing.py b/repoze/bfg/testing.py index 92bb4399a..2e31afce6 100644 --- a/repoze/bfg/testing.py +++ b/repoze/bfg/testing.py @@ -101,7 +101,7 @@ def registerView(name, result='', view=None, for_=(Interface, Interface), from repoze.bfg.interfaces import IView from repoze.bfg.interfaces import ISecuredView from repoze.bfg.security import has_permission - from repoze.bfg.security import Unauthorized + from repoze.bfg.exceptions import Forbidden if view is None: def view(context, request): from webob import Response @@ -111,7 +111,7 @@ def registerView(name, result='', view=None, for_=(Interface, Interface), else: def _secure(context, request): if not has_permission(permission, context, request): - raise Unauthorized('no permission') + raise Forbidden('no permission') else: return view(context, request) _secure.__call_permissive__ = view -- cgit v1.2.3