Permalink
Browse files

Merge branch 'master' into chrisrossi-fix-tx-user

  • Loading branch information...
2 parents 6e24757 + 548ea96 commit b61356f31e578100d151c06337d783e061a97e1e @mmerickel mmerickel committed Feb 12, 2013
Showing with 14 additions and 6 deletions.
  1. +8 −4 CHANGES.txt
  2. +1 −1 pyramid_tm/__init__.py
  3. +5 −1 pyramid_tm/tests.py
View
@@ -1,8 +1,12 @@
-Unreleased
-----------
+next release
+------------
-- Don't call `setUser` on transaction if there is no user logged in. This could
- cause the username set on the transaction to be a strange string: " None".
+- Fix a bug preventing retryable exceptions from actually being retried.
+ https://github.com/Pylons/pyramid_tm/pull/8
+
+- Don't call `setUser` on transaction if there is no user logged in.
+ This could cause the username set on the transaction to be a strange
+ string: " None". https://github.com/Pylons/pyramid_tm/pull/9
0.7 (2012-12-30)
----------------
View
@@ -77,8 +77,8 @@ def tm_tween(request):
except:
exc_info = sys.exc_info()
try:
- manager.abort()
retryable = manager._retryable(*exc_info[:-1])
+ manager.abort()
if (number <= 0) or (not retryable):
reraise(*exc_info)
finally:
View
@@ -237,13 +237,15 @@ def __init__(self, doomed=False, retryable=False):
self.committed = 0
self.aborted = 0
self.retryable = retryable
+ self.active = False
@property
def manager(self):
return self
def _retryable(self, t, v):
- return self.retryable
+ if self.active:
+ return self.retryable
def get(self):
return self
@@ -256,12 +258,14 @@ def isDoomed(self):
def begin(self):
self.began+=1
+ self.active = True
return self
def commit(self):
self.committed+=1
def abort(self):
+ self.active = False
self.aborted+=1
def note(self, value):

0 comments on commit b61356f

Please sign in to comment.