Skip to content

Commit d30e400

Browse files
committed
Move db.commit() call from handle_xmlrpc() to individual methods...
...so actions can control it themselves.
1 parent 28ace85 commit d30e400

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

roundup/cgi/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ def handle_xmlrpc(self):
387387
self.translator,
388388
allow_none=True)
389389
output = handler.dispatch(input)
390-
self.db.commit()
391390

392391
self.setHeader("Content-Type", "text/xml")
393392
self.setHeader("Content-Length", str(len(output)))

roundup/xmlrpc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def create(self, classname, *args):
120120
# do the actual create
121121
try:
122122
result = cl.create(**props)
123+
self.db.commit()
123124
except (TypeError, IndexError, ValueError), message:
124125
raise UsageError, message
125126
return result
@@ -135,9 +136,11 @@ def set(self, designator, *args):
135136
raise Unauthorised('Permission to edit %s of %s denied'%
136137
(p, designator))
137138
try:
138-
return cl.set(itemid, **props)
139+
result = cl.set(itemid, **props)
140+
self.db.commit()
139141
except (TypeError, IndexError, ValueError), message:
140142
raise UsageError, message
143+
return result
141144

142145

143146
builtin_actions = {'retire': actions.Retire}

0 commit comments

Comments
 (0)