Browse Source

Sys id fix

master
venkataakhil 1 year ago
parent
commit
48df14c9d5
  1. 5
      smart_service/apis/publish_api.py

5
smart_service/apis/publish_api.py

@ -745,9 +745,10 @@ def merge_json_files(old_json_path, new_json_path, out_file_path):
var_dict["Variant"]["Systems"][old_sys_key]["Assets"] = i["Assets"] var_dict["Variant"]["Systems"][old_sys_key]["Assets"] = i["Assets"]
for s in i["Subsystems"]: for s in i["Subsystems"]:
old_sub_key = check_key(s["subsys_id"], old_sub_key = check_key(s["sub_systems"],
var_dict["Variant"]["Systems"][old_sys_key]["Subsystems"], var_dict["Variant"]["Systems"][old_sys_key]["Subsystems"],
"Sub System") "Sub System")
if old_sub_key is not None and old_sub_key >= 0: if old_sub_key is not None and old_sub_key >= 0:
var_dict["Variant"]["Systems"][old_sys_key]["Subsystems"][old_sub_key] = s var_dict["Variant"]["Systems"][old_sys_key]["Subsystems"][old_sub_key] = s
else: else:
@ -785,7 +786,7 @@ def check_key(key_name, old_data, type=None):
if type == "Sub System": if type == "Sub System":
try: try:
if old_data[d]["subsys_id"] == key_name: if old_data[d]["sub_systems"] == key_name:
return d return d
except Exception as e2: except Exception as e2:
frappe.log_error("Check key subsystem:",frappe.get_traceback()) frappe.log_error("Check key subsystem:",frappe.get_traceback())

Loading…
Cancel
Save