Skip to content

Commit

Permalink
Replace config.set_request_property by config.add_request_method
Browse files Browse the repository at this point in the history
For compatibility with pyramid 1.10
  • Loading branch information
arnaud-morvan committed Apr 8, 2020
1 parent 69658b5 commit ba8e3f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyramid_ldap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get_connector(request):
registry = request.registry
return Connector(registry, manager)

config.set_request_property(get_connector, 'ldap_connector', reify=True)
config.add_request_method(get_connector, 'ldap_connector', property=True, reify=True)

intr = config.introspectable(
'pyramid_ldap setup',
Expand Down
4 changes: 3 additions & 1 deletion pyramid_ldap/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def test_it_defaults(self):
self._callFUT(config, 'ldap://')
self.assertEqual(config.prop_name, 'ldap_connector')
self.assertEqual(config.prop_reify, True)
self.assertEqual(config.prop_property, True)
request = testing.DummyRequest()
self.assertEqual(config.prop(request).__class__, Connector)

Expand Down Expand Up @@ -304,7 +305,8 @@ def __init__(self):
def add_directive(self, name, fn):
self.directives.append(name)

def set_request_property(self, prop, name, reify=False):
def add_request_method(self, prop, name, property=False, reify=False):
self.prop_property = property
self.prop_reify = reify
self.prop_name = name
self.prop = prop
Expand Down

0 comments on commit ba8e3f1

Please sign in to comment.