def clear_cache(path=None): if path: delete_page_cache(path) else: clear_sitemap() frappe.clear_cache("Guest") frappe.cache().delete_value("_website_pages") clear_permissions() for method in frappe.get_hooks("website_clear_cache"): frappe.get_attr(method)(path)
def clear_cache(path=None): if path: delete_page_cache(path) else: clear_sitemap() frappe.clear_cache("Guest") frappe.cache().delete_value("_website_pages") clear_permissions() for method in frappe.get_hooks("website_clear_cache"): frappe.get_attr(method)(path)
def clear_cache(path=None): cache = frappe.cache() if path: delete_page_cache(path) else: for p in frappe.db.sql_list("""select name from `tabWebsite Route`"""): if p is not None: delete_page_cache(p) cache.delete_value("home_page") clear_permissions() for method in frappe.get_hooks("website_clear_cache"): frappe.get_attr(method)(path)
def clear_cache(path=None): cache = frappe.cache() if path: delete_page_cache(path) else: for p in frappe.db.sql_list("""select name from `tabWebsite Route`"""): if p is not None: delete_page_cache(p) cache.delete_value("home_page") clear_permissions() for method in frappe.get_hooks("website_clear_cache"): frappe.get_attr(method)(path)
def clear_cache(path=None): cache = frappe.cache() if path: delete_page_cache(path) for p in frappe.db.sql_list('''select name from `tabWebsite Route` where name like "{0}/%"'''.format(path.replace('"', '\"'))): delete_page_cache(p) else: for p in frappe.db.sql_list("""select name from `tabWebsite Route`"""): if p is not None: delete_page_cache(p) frappe.clear_cache("Guest") clear_permissions() for method in frappe.get_hooks("website_clear_cache"): frappe.get_attr(method)(path)
def on_update(self): remove_empty_permissions() clear_permissions(self.doc.profile)
def on_update(self): remove_empty_permissions() clear_permissions(self.user)
def on_update(self): remove_empty_permissions() clear_permissions(self.user)