diff options
| author | Michael Merickel <michael@merickel.org> | 2014-04-18 16:54:26 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-04-18 16:54:26 -0500 |
| commit | c31c6160154d1608ac79458b284f67554d185eae (patch) | |
| tree | c92771ada1ec569631e283c5ea4b3ad22dae5edd | |
| parent | 90e15ba98fc072c44adfbacc2de36ead130214ac (diff) | |
| parent | 8e90d62c0d50565e717738901e8a10a865ac1258 (diff) | |
| download | pyramid-c31c6160154d1608ac79458b284f67554d185eae.tar.gz pyramid-c31c6160154d1608ac79458b284f67554d185eae.tar.bz2 pyramid-c31c6160154d1608ac79458b284f67554d185eae.zip | |
Merge pull request #1306 from bertjwregeer/fix.add_predicates_maybe_dotted
Fix: add predicates maybe dotted
| -rw-r--r-- | CHANGES.txt | 5 | ||||
| -rw-r--r-- | pyramid/config/__init__.py | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 264497f5b..3d2b248ae 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,10 @@ Next release ============ -- ... +- Fix an issue whereby predicates would be resolved as maybe_dotted in the + introspectable but not when passed for registration. This would mean that + add_route_predicate for example can not take a string and turn it into the + actual callable function. 1.5 (2014-04-08) ================ diff --git a/pyramid/config/__init__.py b/pyramid/config/__init__.py index 32cf82fba..ebaae38a9 100644 --- a/pyramid/config/__init__.py +++ b/pyramid/config/__init__.py @@ -481,6 +481,7 @@ class Configurator( def _add_predicate(self, type, name, factory, weighs_more_than=None, weighs_less_than=None): + factory = self.maybe_dotted(factory) discriminator = ('%s predicate' % type, name) intr = self.introspectable( '%s predicates' % type, @@ -488,7 +489,7 @@ class Configurator( '%s predicate named %s' % (type, name), '%s predicate' % type) intr['name'] = name - intr['factory'] = self.maybe_dotted(factory) + intr['factory'] = factory intr['weighs_more_than'] = weighs_more_than intr['weighs_less_than'] = weighs_less_than def register(): |
