From 644961991977be030cb22451f1183e65d5897174 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 3 Oct 2008 03:18:46 +0000 Subject: Python 2.6 forward compatibility: message is deprecated. --- repoze/bfg/security.py | 6 +----- repoze/bfg/view.py | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/repoze/bfg/security.py b/repoze/bfg/security.py index 49f47bc89..ee54c7971 100644 --- a/repoze/bfg/security.py +++ b/repoze/bfg/security.py @@ -308,11 +308,7 @@ class ViewPermissionFactory(object): return ViewPermission(context, request, self.permission_name) class Unauthorized(Exception): - def __init__(self, message='Unauthorized'): - self.message = message + pass - def __str__(self): - return str(self.message) - diff --git a/repoze/bfg/view.py b/repoze/bfg/view.py index e3f22dc08..5426b53e5 100644 --- a/repoze/bfg/view.py +++ b/repoze/bfg/view.py @@ -16,7 +16,7 @@ def render_view_to_response(context, request, name='', secure=True): calling the view function. If the permission check disallows view execution (based on the current security policy), a ``repoze.bfg.security.Unauthorized`` exception will be raised; its - ``message`` attribute explains why the view access was disallowed. + ``args`` attribute explains why the view access was disallowed. If ``secure`` is ``False``, no permission checking is done.""" if secure: security_policy = queryUtility(ISecurityPolicy) @@ -45,7 +45,7 @@ def render_view_to_iterable(context, request, name='', secure=True): view function. If the permission check disallows view execution (based on the current security policy), a ``repoze.bfg.security.Unauthorized`` exception will be raised; its - ``message`` attribute explains why the view access was disallowed. + ``args`` attribute explains why the view access was disallowed. If ``secure`` is ``False``, no permission checking is done.""" response = render_view_to_response(context, request, name, secure) if response is None: @@ -68,7 +68,7 @@ def render_view(context, request, name='', secure=True): function. If the permission check disallows view execution (based on the current security policy), a ``repoze.bfg.security.Unauthorized`` exception will be raised; its - ``message`` attribute explains why the view access was disallowed. + ``args`` attribute explains why the view access was disallowed. If ``secure`` is ``False``, no permission checking is done.""" iterable = render_view_to_iterable(context, request, name, secure) if iterable is None: -- cgit v1.2.3