aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/serve.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-01-01 16:48:03 -0500
committerW. Trevor King <wking@drexel.edu>2010-01-01 16:48:03 -0500
commitf114d9add0610c025110681c09a2f2eb4acedfa5 (patch)
tree4eb89b1ee87f00d2ae4a7304b3e3eb4ed3c23904 /libbe/command/serve.py
parent0679e0b1fd941d6aefef146fb4289472edee9b62 (diff)
downloadbugseverywhere-f114d9add0610c025110681c09a2f2eb4acedfa5.tar.gz
Fixed commit handling in commands.serve and storage.http
Diffstat (limited to 'libbe/command/serve.py')
-rw-r--r--libbe/command/serve.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbe/command/serve.py b/libbe/command/serve.py
index 555a7ab..e98787f 100644
--- a/libbe/command/serve.py
+++ b/libbe/command/serve.py
@@ -214,15 +214,19 @@ class BERequestHandler (server.BaseHTTPRequestHandler):
self.send_error(406, 'Missing query key summary')
return (None,None)
summary = data['summary']
- if not body in data or data['body'] == 'None':
+ if not 'body' in data or data['body'] == 'None':
data['body'] = None
body = data['body']
- if not allow_empty in data \
+ if not 'allow_empty' in data \
or data['allow_empty'] == 'True':
allow_empty = True
else:
allow_empty = False
- self.s.commit(summary, body, allow_empty)
+ try:
+ self.s.commit(summary, body, allow_empty)
+ except libbe.storage.EmptyCommit, e:
+ self.send_error(HTTP_USER_ERROR, 'EmptyCommit')
+ return (None,None)
self.send_response(200)
return (None,None)