Code

Move db.commit() call from handle_xmlrpc() to individual methods, so actions can...
authorstefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sun, 19 Jul 2009 22:56:30 +0000 (22:56 +0000)
committerstefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sun, 19 Jul 2009 22:56:30 +0000 (22:56 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4328 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/cgi/client.py
roundup/xmlrpc.py

index 6208de88ebb08bd89929aa06a75a59b1f1c125d1..0407abdbecc60fb98d09170305c4ad21606c50da 100644 (file)
@@ -387,7 +387,6 @@ class Client:
                                            self.translator,
                                            allow_none=True)
         output = handler.dispatch(input)
-        self.db.commit()
 
         self.setHeader("Content-Type", "text/xml")
         self.setHeader("Content-Length", str(len(output)))
index f41c6d6f5905cfde0fb8ce966f6346abac677892..4e0d19ad38be7f42ef49c0e405aa8d1a48fe6e64 100644 (file)
@@ -120,6 +120,7 @@ class RoundupInstance:
         # do the actual create
         try:
             result = cl.create(**props)
+            self.db.commit()
         except (TypeError, IndexError, ValueError), message:
             raise UsageError, message
         return result
@@ -135,9 +136,11 @@ class RoundupInstance:
                 raise Unauthorised('Permission to edit %s of %s denied'%
                                    (p, designator))
         try:
-            return cl.set(itemid, **props)
+            result = cl.set(itemid, **props)
+            self.db.commit()
         except (TypeError, IndexError, ValueError), message:
             raise UsageError, message
+        return result
 
 
     builtin_actions = {'retire': actions.Retire}