benoitc/couchdbkit

fetch_attachment does not consider '_rev_'

Opened this issue · 0 comments

As far I can see (and test) fetch_attachment does not consider the _rev field when it is passed in the "doc".

This can cause problems: we are going to get always the latest document, avoiding any conflict.

Here my patch:

$ diff client.py ~/sources/couchdbkit-0.6.5/couchdbkit/client.py 
855d854
<             doc = {}
863c862
<         resp = self.res(docid).get(name, headers=headers, rev=doc.get('_rev'))

---
>         resp = self.res(docid).get(name, headers=headers)