[fix] show doctype, fieldname in unique validation

This commit is contained in:
Anand Doshi 2015-09-03 11:42:07 +05:30
parent 7a2b8f91b2
commit 5e445476f3

View file

@ -250,7 +250,7 @@ class DbTable:
frappe.throw(str(e))
elif e.args[0]==1062:
fieldname = str(e).split("'")[-2]
frappe.throw(_("{0} field cannot be set as unique, as there are non-unique existing values".format(fieldname)))
frappe.throw(_("{0} field cannot be set as unique in {1}, as there are non-unique existing values".format(fieldname, self.name)))
else:
raise e