couchdbkit icon indicating copy to clipboard operation
couchdbkit copied to clipboard

Keyerror when saving security docs

Open muellermichel opened this issue 11 years ago • 1 comments

This issue is related to #134.

There still seems to be a problem when saving security documents. I get

File "/usr/local/lib/python2.7/dist-packages/couchdbkit/client.py", line 513, in save_doc;     doc1.update({'_id': res['id'], '_rev': res['rev']});KeyError: 'id';

The code lines in question are 510ff in client.py:

if 'batch' in params and 'id' in res:
        doc1.update({ '_id': res['id']})
    else:
        doc1.update({'_id': res['id'], '_rev': res['rev']})

Obviously, the 'id' in res check is useless since in the else case it's still being accessed directly from the response dict.

muellermichel avatar Feb 19 '14 11:02 muellermichel

use: db.set_security(secobj)

DaniloOliveira28 avatar Apr 04 '16 04:04 DaniloOliveira28