fix(module-def): add validation for rename (#37001)
This commit is contained in:
parent
be12bbaa9f
commit
bdd5c15bfc
1 changed files with 5 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import os
|
|||
from pathlib import Path
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.modules.export_file import delete_folder
|
||||
|
||||
|
|
@ -89,6 +90,10 @@ class ModuleDef(Document):
|
|||
frappe.clear_cache()
|
||||
frappe.setup_module_map()
|
||||
|
||||
def before_rename(self, old, new, merge=False):
|
||||
if not self.custom:
|
||||
frappe.throw(_("Only Custom Modules can be renamed."))
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_installed_apps():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue