From 35b52557000caf29fe8f4e1c9a5856ba22389fcd Mon Sep 17 00:00:00 2001 From: stefan Date: Sun, 19 Jul 2009 22:56:30 +0000 Subject: [PATCH] Move db.commit() call from handle_xmlrpc() to individual methods, so actions can control it themselves. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4328 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/client.py | 1 - roundup/xmlrpc.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 6208de8..0407abd 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -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))) diff --git a/roundup/xmlrpc.py b/roundup/xmlrpc.py index f41c6d6..4e0d19a 100644 --- a/roundup/xmlrpc.py +++ b/roundup/xmlrpc.py @@ -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} -- 2.30.2