From 8c4eb9e365e7167b0f002eb9ad44634debd56957 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 28 Mar 2011 08:59:14 -0400 Subject: branch coverage --- pyramid/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyramid/config.py b/pyramid/config.py index 1f4b85de0..906c5f935 100644 --- a/pyramid/config.py +++ b/pyramid/config.py @@ -395,13 +395,13 @@ class Configurator(object): @action_method def _set_security_policies(self, authentication, authorization=None): - if authorization is None: - authorization = ACLAuthorizationPolicy() # default - if authorization and not authentication: + if (authorization is not None) and (not authentication): raise ConfigurationError( 'If the "authorization" is passed a value, ' 'the "authentication" argument must also be ' 'passed a value; authorization requires authentication.') + if authorization is None: + authorization = ACLAuthorizationPolicy() # default self._set_authentication_policy(authentication) self._set_authorization_policy(authorization) -- cgit v1.2.3