Fixed text update.
authorŁukasz Rekucki <lrekucki@gmail.com>
Mon, 28 Sep 2009 14:20:26 +0000 (16:20 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Mon, 28 Sep 2009 14:20:26 +0000 (16:20 +0200)
apps/api/handlers/library_handlers.py

index c5666dd..64b95c2 100644 (file)
@@ -284,14 +284,14 @@ class DocumentTextHandler(BaseHandler):
 
             try:
                 # return the new revision number
-                return {
+                return response.SuccessAllOk.django_response({
                     "document": ndoc.id,
                     "subview": "xml",
                     "previous_revision": current.revision,
                     "updated_revision": ndoc.revision
-                }
+                })
             except Exception, e:
-                lib._rollback()
+                if ndoc: lib._rollback()
                 raise e        
         except RevisionNotFound, e:
             return response.EntityNotFound().django_response(e)