refactor: clean up code to py39+ supported syntax - f-strings instead of format - latest typing support instead of pre 3.9 TitleCase - remove UTF-8 declarations. - many more changes Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
14 lines
429 B
Python
14 lines
429 B
Python
import frappe
|
|
|
|
|
|
def execute():
|
|
column = "apply_user_permissions"
|
|
to_remove = ["DocPerm", "Custom DocPerm"]
|
|
|
|
for doctype in to_remove:
|
|
if frappe.db.table_exists(doctype):
|
|
if column in frappe.db.get_table_columns(doctype):
|
|
frappe.db.sql(f"alter table `tab{doctype}` drop column {column}")
|
|
|
|
frappe.reload_doc("core", "doctype", "docperm", force=True)
|
|
frappe.reload_doc("core", "doctype", "custom_docperm", force=True)
|