Pārlūkot izejas kodu

fix: dont mutate `df` when creating custom fields

(cherry picked from commit e3d581afdf)
version-14
Sagar Vora pirms 2 gadiem
committed by Mergify
vecāks
revīzija
aac89f13d4
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. +3
    -0
      frappe/custom/doctype/custom_field/custom_field.py

+ 3
- 0
frappe/custom/doctype/custom_field/custom_field.py Parādīt failu

@@ -186,10 +186,13 @@ def create_custom_fields(custom_fields, ignore_validate=False, update=True):
field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": df["fieldname"]})
if not field:
try:
df = df.copy()
df["owner"] = "Administrator"
create_custom_field(doctype, df, ignore_validate=ignore_validate)

except frappe.exceptions.DuplicateEntryError:
pass

elif update:
custom_field = frappe.get_doc("Custom Field", field)
custom_field.flags.ignore_validate = ignore_validate


Notiek ielāde…
Atcelt
Saglabāt