[fix] show doctype, fieldname in unique validation
This commit is contained in:
parent
7a2b8f91b2
commit
5e445476f3
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue