fix(module-def): add validation for rename (#37001)

This commit is contained in:
Sowmya 2026-02-19 12:51:18 +05:30 committed by GitHub
parent be12bbaa9f
commit bdd5c15bfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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():