From 8af9c463152500f0e5d9ed742e9dd1c869c04705 Mon Sep 17 00:00:00 2001 From: aruizramon Date: Wed, 6 Apr 2016 09:54:27 -0400 Subject: [PATCH] Added custom field name, as well as label, in Not Found error message. Previously, it was hard to find which field was causing the problem when the field did not have a label - such as column breaks --- frappe/custom/doctype/custom_field/custom_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index 85c38e813b..4c62777caa 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -60,8 +60,8 @@ class CustomField(Document): def validate_insert_after(self, meta): if not meta.get_field(self.insert_after): - frappe.throw(_("Insert After field '{0}' mentioned in Custom Field '{1}', does not exist") - .format(self.insert_after, self.label), frappe.DoesNotExistError) + frappe.throw(_("Insert After field '{0}' mentioned in Custom Field '{1}', with label '{2}', does not exist") + .format(self.insert_after, self.name, self.label), frappe.DoesNotExistError) if self.fieldname == self.insert_after: frappe.throw(_("Insert After cannot be set as {0}").format(meta.get_label(self.insert_after)))