fix: route conflict not detected when workspace matches existing DocType

This commit is contained in:
KerollesFathy 2026-03-10 15:52:15 +00:00
parent 088ae90c9f
commit b969282e8f

View file

@ -17,7 +17,11 @@ def validate_route_conflict(doctype, name):
all_names = []
for _doctype in ["Page", "Workspace", "DocType"]:
all_names.extend(
[slug(d) for d in frappe.get_all(_doctype, pluck="name") if (doctype != _doctype and d != name)]
[
slug(d)
for d in frappe.get_all(_doctype, pluck="name")
if not (doctype == _doctype and d == name)
]
)
if slug(name) in all_names: