summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-12-23 13:31:54 -0600
committerMichael Merickel <michael@merickel.org>2019-12-23 13:40:07 -0600
commitc52cfec057a9e22b794da655eac1708dfba8bef7 (patch)
treee6ac9fa41010ef4e5780eff7057df29886ca5de1 /src
parent014b5ecedec76fd7bbade6c954adce94954bd171 (diff)
downloadpyramid-c52cfec057a9e22b794da655eac1708dfba8bef7.tar.gz
pyramid-c52cfec057a9e22b794da655eac1708dfba8bef7.tar.bz2
pyramid-c52cfec057a9e22b794da655eac1708dfba8bef7.zip
modify deprecation warning
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/config/routes.py11
-rw-r--r--src/pyramid/config/views.py11
-rw-r--r--src/pyramid/predicates.py18
3 files changed, 22 insertions, 18 deletions
diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py
index 4b26b7481..daef8e9f2 100644
--- a/src/pyramid/config/routes.py
+++ b/src/pyramid/config/routes.py
@@ -332,6 +332,17 @@ class RoutesConfiguratorMixin(object):
stacklevel=3,
)
+ if 'effective_principals' in predicates:
+ warnings.warn(
+ (
+ 'The new security policy has removed the concept of '
+ 'principals. See "Upgrading Authentication/Authorization" '
+ 'in "What\'s New in Pyramid 2.0" for more information.'
+ ),
+ DeprecationWarning,
+ stacklevel=3,
+ )
+
if accept is not None:
if not is_nonstr_iter(accept):
accept = [accept]
diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py
index bc0b05a08..1c17d2343 100644
--- a/src/pyramid/config/views.py
+++ b/src/pyramid/config/views.py
@@ -791,6 +791,17 @@ class ViewsConfiguratorMixin(object):
stacklevel=4,
)
+ if 'effective_principals' in view_options:
+ warnings.warn(
+ (
+ 'The new security policy has removed the concept of '
+ 'principals. See "Upgrading Authentication/Authorization" '
+ 'in "What\'s New in Pyramid 2.0" for more information.'
+ ),
+ DeprecationWarning,
+ stacklevel=4,
+ )
+
if accept is not None:
if is_nonstr_iter(accept):
raise ConfigurationError(
diff --git a/src/pyramid/predicates.py b/src/pyramid/predicates.py
index 83f7f3295..32c6a4089 100644
--- a/src/pyramid/predicates.py
+++ b/src/pyramid/predicates.py
@@ -1,7 +1,5 @@
import re
-from zope.deprecation import deprecated
-
from pyramid.exceptions import ConfigurationError
from pyramid.traversal import (
@@ -271,28 +269,12 @@ class PhysicalPathPredicate(object):
class EffectivePrincipalsPredicate(object):
- """
- .. deprecated:: 2.0
-
- The new security system has removed the concept of principals. See
- :ref:`upgrading_auth` for more information.
-
- """
-
def __init__(self, val, config):
if is_nonstr_iter(val):
self.val = set(val)
else:
self.val = set((val,))
- __init__ = deprecated(
- __init__,
- 'The new security policy has removed the concept of principals. See '
- 'https://docs.pylonsproject.org/projects/pyramid/en/latest'
- '/whatsnew-2.0.html#upgrading-authentication-authorization '
- 'for more information.',
- )
-
def text(self):
return 'effective_principals = %s' % sorted(list(self.val))