projects
/
py-rsbac
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b43f42c
)
Changed behavior of the "ttl" argument of the withTransaction function.
author
Frédéric Jolliton
<git@frederic.jolliton.com>
Sat, 21 Oct 2006 23:03:45 +0000
(23:03 +0000)
committer
Frédéric Jolliton
<git@frederic.jolliton.com>
Sat, 21 Oct 2006 23:03:45 +0000
(23:03 +0000)
rsbac/transaction.py
patch
|
blob
|
history
diff --git
a/rsbac/transaction.py
b/rsbac/transaction.py
index
769ad36
..
9cf8e33
100644
(file)
--- a/
rsbac/transaction.py
+++ b/
rsbac/transaction.py
@@
-70,7
+70,11
@@
def _with( o , fun , args = () ) :
def withCurrentTransaction( n , fun ) :
return _with( CurrentTransaction( n ) , fun )
-def withTransaction( fun , uid = g_ALL_USERS , password = None , ttl = 0 ) :
+def withTransaction( fun , uid = g_ALL_USERS , password = None , ttl = None ) :
+ if ttl is None :
+ ttl = 0
+ else :
+ ttl = max( ttl , 1 )
n = begin( uid , password , ttl )
try :
_with( CurrentTransaction( n ) , fun , ( Transaction( n ) , ) )