]> git.decadent.org.uk Git - dak.git/commitdiff
If positional argument is None, modify it.s
authorChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 15:26:01 +0000 (15:26 +0000)
committerChris Lamb <lamby@debian.org>
Tue, 27 Oct 2009 15:26:01 +0000 (15:26 +0000)
daklib/dbconn.py

index 39285f0872673cd28c07fd59303bdabb97fa417d..adecc38a7f060d6c9876be399e6d6b4df3fb3034 100755 (executable)
@@ -83,6 +83,9 @@ def session_wrapper(fn):
             else:
                 # Session is last argument in args
                 session = args[-1]
+                if session is None:
+                    session = args[-1] = DBConn().session()
+                    private_transaction = True
 
         if private_transaction:
             session.commit_or_flush = session.commit