From 03069ff0845c1b85c21119985e8157d54e7ce71c Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Mon, 16 Dec 2019 11:37:45 -0800 Subject: Fix EffectivePrincipalsPredicate deprecation warning. Fired upon registering, not upon use. --- src/pyramid/predicates.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/pyramid/predicates.py b/src/pyramid/predicates.py index a09933253..83f7f3295 100644 --- a/src/pyramid/predicates.py +++ b/src/pyramid/predicates.py @@ -285,6 +285,14 @@ class EffectivePrincipalsPredicate(object): 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)) @@ -299,15 +307,6 @@ class EffectivePrincipalsPredicate(object): return False -deprecated( - 'EffectivePrincipalsPredicate', - '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.', -) - - class Notted(object): def __init__(self, predicate): self.predicate = predicate -- cgit v1.2.3