Commit 7f77e23f authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Fix NoWildcardAcceptPredicate compat with pyramid 1.10

self.val has been renamed to self.values
(grafted from 0ec8ffbeb8f8)

--HG--
branch : 0.2
parent d441fcad8f24
......@@ -19,7 +19,7 @@ __depends__ = {
'six': '>= 1.4.0',
'iso8601': None,
'jsl': None,
'pyramid': '>= 1.8.0',
'pyramid': '>= 1.10.0',
}
__recommends__ = {}
......
......@@ -26,7 +26,11 @@ class NoWildcardAcceptPredicate(predicates.AcceptPredicate):
"""
def __call__(self, context, request):
return self.val in [h for h in request.accept if h != '*/*']
request_accepts = [h for h in request.accept if h != '*/*']
for accept_type in self.values:
if accept_type in request_accepts:
return True
return False
def includeme(config):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment