Issue while Custom Naming Series ( autoname doc_event )

When i Set autoname method in doc_events server is checking doctype :
hooks.py

doc_events = {
“*”: {
“autoname”: “custom_series_app.api.mtpl_custom_autoname”
},
}
def mtpl_custom_autoname(self, method):
if self.doctype in [“Custom MTPL Naming Series”, “Document Table”, “DocField”] or
self.doctype in [“Deleted Document”, ‘Installed Application’]:
return

custom_naming_setting = frappe.get_single("Custom MTPL Naming Series")
self.name = make_autoname(series)

Now I am not able to remove or uninstall the application and when i run bench migrate it throws error as below:

builtins.ImportError: Module import failed for Custom MTPL Naming Series, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.custom_mtpl_naming_series’