fix: enqueue publish on update and trash
This commit is contained in:
parent
dcbbe68bec
commit
d8de63b341
1 changed files with 10 additions and 0 deletions
|
|
@ -81,8 +81,18 @@ class WebsiteGenerator(Document):
|
|||
'''Return breadcrumbs'''
|
||||
pass
|
||||
|
||||
def on_update(self):
|
||||
if frappe.db.get_single_value('Google Indexing', 'enable_indexing'):
|
||||
url = frappe.utils.get_url(self.route)
|
||||
frappe.enqueue('frappe.integrations.doctype.google_indexing.google_indexing.publish_site', \
|
||||
url=url)
|
||||
|
||||
def on_trash(self):
|
||||
self.clear_cache()
|
||||
if frappe.db.get_single_value('Google Indexing', 'enable_indexing'):
|
||||
url = frappe.utils.get_url(self.route)
|
||||
frappe.enqueue('frappe.integrations.doctype.google_indexing.google_indexing.publish_site', \
|
||||
url=url, operation_type='URL_DELETED')
|
||||
|
||||
def is_website_published(self):
|
||||
"""Return true if published in website"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue