benoitc / benoitc/couchdbkit

Keyerror when saving security docs

Open
#177 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
263
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.