fix: validation to prevent Page names being the same as DocType names
This commit is contained in:
parent
43184b82a1
commit
f00dd46e3f
1 changed files with 5 additions and 0 deletions
|
|
@ -33,6 +33,11 @@ class Page(Document):
|
|||
self.name += '-' + str(cnt)
|
||||
|
||||
def validate(self):
|
||||
if frappe.db.get_value('DocType', self.name):
|
||||
frappe.throw(
|
||||
_("{} is the name of a DocType. DocType names cannot be the same as a Page name, please choose another name.").format(self.page_name)
|
||||
)
|
||||
|
||||
if self.is_new() and not getattr(conf,'developer_mode', 0):
|
||||
frappe.throw(_("Not in Developer Mode"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue