소스 검색

fix: Remove trailing whitespace in translatable str

Simplify conditional block and str appending
version-14
Gavin D'souza 4 년 전
부모
커밋
6fb14120d9
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. +2
    -4
      frappe/model/mapper.py

+ 2
- 4
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): def map_doc(source_doc, target_doc, table_map, source_parent=None):
if table_map.get("validation"): if table_map.get("validation"):
for key, condition in table_map["validation"].items(): 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) map_fields(source_doc, target_doc, table_map, source_parent)




불러오는 중...
취소
저장