Skip to content

Commit

Permalink
find_doc returns string, load into json.
Browse files Browse the repository at this point in the history
  • Loading branch information
wonlay committed Jan 16, 2012
1 parent f5db9e2 commit 6dba451
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/content_store/views.py
Expand Up @@ -692,6 +692,8 @@ def updateDoc(request,store_name):
resp = {'ok':False,'error':'doc: %d does not exist' % uid}
return HttpResponseBadRequest(json.dumps(resp))

existingDoc = json.loads(existingDoc)

for k,v in jsonDoc.items():
existingDoc[k]=v

Expand All @@ -702,6 +704,7 @@ def updateDoc(request,store_name):
resp = {'ok':False,'error':'invalid json: %s' % doc}
return HttpResponseBadRequest(json.dumps(resp))
except Exception as e:
logging.exception(e)
resp = {'ok':False,'error':e.message}
return HttpResponseServerError(json.dumps(resp))

Expand Down

0 comments on commit 6dba451

Please sign in to comment.