Commit f041d753 authored by Guillaume Vandevelde's avatar Guillaume Vandevelde
Browse files

[pyramid] Adapt the base code to use pyramid 1.10.XX

--HG--
branch : 0.1
parent 1adc34b087aa
......@@ -19,7 +19,7 @@ __depends__ = {
'six': '>= 1.4.0',
'jsonschema': None,
'jsl': None,
'pyramid': '< 1.10.0',
'pyramid': '>= 1.10.0',
}
__recommends__ = {}
......
......@@ -16,7 +16,7 @@
"""cubicweb-jsonschema predicates"""
from pyramid.config import predicates
from pyramid import predicates
class NoWildcardAcceptPredicate(predicates.AcceptPredicate):
......@@ -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