Browse Source

fix(patch): Pass if table is missing (#12302)

version-14
Suraj Shetty 4 years ago
committed by GitHub
parent
commit
99fe0412b3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      frappe/desk/utils.py

+ 4
- 3
frappe/desk/utils.py View File

@@ -7,12 +7,13 @@ def validate_route_conflict(doctype, name):
'''
Raises exception if name clashes with routes from other documents for /app routing
'''
if frappe.flags.ignore_route_conflict_validation:
return

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)])
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

if slug(name) in all_names:
frappe.msgprint(frappe._('Name already taken, please set a new name'))


Loading…
Cancel
Save