From 6fb14120d9dcce31a080aaa68e21616c44b3ca35 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 27 May 2021 13:47:55 +0530 Subject: [PATCH] fix: Remove trailing whitespace in translatable str Simplify conditional block and str appending --- frappe/model/mapper.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frappe/model/mapper.py b/frappe/model/mapper.py index 8b1543c99e..fa8858d950 100644 --- a/frappe/model/mapper.py +++ b/frappe/model/mapper.py @@ -137,10 +137,8 @@ def get_mapped_doc(from_doctype, from_docname, table_maps, target_doc=None, def map_doc(source_doc, target_doc, table_map, source_parent=None): if table_map.get("validation"): for key, condition in table_map["validation"].items(): - if condition[0]=="=": - if source_doc.get(key) != condition[1]: - frappe.throw(_("Cannot map because following condition fails: ") - + key + "=" + cstr(condition[1])) + if condition[0] == "=" and source_doc.get(key) != condition[1]: + frappe.throw(_("Cannot map because following condition fails:") + f" {key}={cstr(condition[1])}") map_fields(source_doc, target_doc, table_map, source_parent)