Parcourir la source

[minor] on save and trash, clear cache of website, if it contains table of contents

version-14
Anand Doshi il y a 11 ans
Parent
révision
c27c5f493f
1 fichiers modifiés avec 11 ajouts et 1 suppressions
  1. +11
    -1
      website/doctype/web_page/web_page.py

+ 11
- 1
website/doctype/web_page/web_page.py Voir le fichier

@@ -17,7 +17,17 @@ class DocType():
update_page_name(self.doc, self.doc.title) update_page_name(self.doc, self.doc.title)
self.if_home_clear_cache() self.if_home_clear_cache()
# clear all cache if toc is updated
# clear all cache if it has toc
if self.doclist.get({"parentfield": "toc"}):
from webnotes.webutils import clear_cache
clear_cache()
def on_trash(self):
# delete entry from Table of Contents of other pages
webnotes.conn.sql("""delete from `tabTable of Contents`
where web_page=%s""", self.doc.name)
# clear all cache if it has toc
if self.doclist.get({"parentfield": "toc"}): if self.doclist.get({"parentfield": "toc"}):
from webnotes.webutils import clear_cache from webnotes.webutils import clear_cache
clear_cache() clear_cache()


Chargement…
Annuler
Enregistrer