From 43a15e2a930195c493989fd8a83b02d999b31e52 Mon Sep 17 00:00:00 2001 From: Minha Date: Mon, 20 Nov 2023 11:59:21 -0500 Subject: [PATCH] Lint fixes --- corehq/util/couch.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/corehq/util/couch.py b/corehq/util/couch.py index fedfccc898b3..944642d5f809 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__, @@ -332,8 +331,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) @@ -342,8 +341,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: