diff --git a/corehq/util/couch.py b/corehq/util/couch.py index 853836c152f5..e9ec7f73a616 100644 --- a/corehq/util/couch.py +++ b/corehq/util/couch.py @@ -42,9 +42,8 @@ def _get_document_or_not_found_lite(cls, doc_id): def get_document_or_not_found(cls, domain, doc_id, additional_doc_types=None): allowed_doc_types = (additional_doc_types or []) + [cls.__name__] unwrapped = _get_document_or_not_found_lite(cls, doc_id) - if ((unwrapped.get('domain', None) != domain and - domain not in unwrapped.get('domains', [])) or - unwrapped['doc_type'] not in allowed_doc_types): + if ((unwrapped.get('domain', None) != domain and domain not in unwrapped.get('domains', [])) + or unwrapped['doc_type'] not in allowed_doc_types): raise DocumentNotFound("Document {} of class {} not in domain {}!".format( doc_id, cls.__name__, @@ -334,8 +333,8 @@ def _iter_update(doc_ids, try_num): if iter_db.error_ids: if try_num >= max_retries: results.error_ids.update(iter_db.error_ids) - msg = ("The following documents did not correctly save:\n" + - ", ".join(results.error_ids)) + msg = ("The following documents did not correctly save:\n" + + ", ".join(results.error_ids)) raise IterUpdateError(results, msg) else: _iter_update(iter_db.error_ids, try_num + 1) @@ -344,8 +343,8 @@ def _iter_update(doc_ids, try_num): if results.error_ids: msg = ("The following docs didn't correctly save. Are you sure fn {} " "returned either None or an instance of DocUpdate? Did you " - "change or remove the '_id' field?".format(fn.__name__) + - ", ".join(results.error_ids)) + "change or remove the '_id' field?".format(fn.__name__) + + ", ".join(results.error_ids)) raise IterUpdateError(results, msg) if verbose: