summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodwillcoding <goodwillcoding@webhippo.net>2014-04-19 21:29:02 -0700
committergoodwillcoding <goodwillcoding@webhippo.net>2014-04-19 21:29:02 -0700
commit437b4b698f71614793bb15ca5388b249842a9885 (patch)
tree6544fbfeb2aab51677ffda2792b5b55b6b2a3ef7
parent28cf6b65423b4c7e58afbf2850857a898dc29fbb (diff)
parentc31c6160154d1608ac79458b284f67554d185eae (diff)
downloadpyramid-437b4b698f71614793bb15ca5388b249842a9885.tar.gz
pyramid-437b4b698f71614793bb15ca5388b249842a9885.tar.bz2
pyramid-437b4b698f71614793bb15ca5388b249842a9885.zip
Merge branch 'master' of github.com:Pylons/pyramid into scaffold_version
-rw-r--r--CHANGES.txt5
-rw-r--r--docs/api/request.rst8
-rw-r--r--pyramid/config/__init__.py3
3 files changed, 13 insertions, 3 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/docs/api/request.rst b/docs/api/request.rst
index 343d0c022..77d80f6d6 100644
--- a/docs/api/request.rst
+++ b/docs/api/request.rst
@@ -319,7 +319,13 @@
def _connect(request):
conn = request.registry.dbsession()
- def cleanup(_):
+ def cleanup(request):
+ # since version 1.5, request.exception is no
+ # longer eagerly cleared
+ if request.exception is not None:
+ conn.rollback()
+ else:
+ conn.commit()
conn.close()
request.add_finished_callback(cleanup)
return conn
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():