fix: Ignore route conflict validations during migrate
This commit is contained in:
parent
5348dd1f29
commit
8d133ce32a
1 changed files with 6 additions and 8 deletions
|
|
@ -9,16 +9,14 @@ def validate_route_conflict(doctype, name):
|
|||
Raises exception if name clashes with routes from other documents for /app routing
|
||||
"""
|
||||
|
||||
if frappe.flags.in_migrate:
|
||||
return
|
||||
|
||||
all_names = []
|
||||
for _doctype in ["Page", "Workspace", "DocType"]:
|
||||
try:
|
||||
all_names.extend(
|
||||
[
|
||||
slug(d) for d in frappe.get_all(_doctype, pluck="name") if (doctype != _doctype and d != name)
|
||||
]
|
||||
)
|
||||
except frappe.db.TableMissingError:
|
||||
pass
|
||||
all_names.extend(
|
||||
[slug(d) for d in frappe.get_all(_doctype, pluck="name") if (doctype != _doctype and d != name)]
|
||||
)
|
||||
|
||||
if slug(name) in all_names:
|
||||
frappe.msgprint(frappe._("Name already taken, please set a new name"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue