mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
[website] [cleanup] moved website generic utils to framework
This commit is contained in:
@@ -8,7 +8,7 @@ class DocType:
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def on_update(self):
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache("about")
|
||||
|
||||
def get_args():
|
||||
|
||||
@@ -9,6 +9,6 @@ class DocType:
|
||||
|
||||
def on_update(self):
|
||||
# for blog footer
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import webnotes
|
||||
import website.utils
|
||||
import webnotes.webutils
|
||||
from webnotes import _
|
||||
|
||||
class DocType:
|
||||
@@ -25,7 +25,7 @@ class DocType:
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def autoname(self):
|
||||
from website.utils import page_name
|
||||
from webnotes.webutils import page_name
|
||||
self.doc.name = page_name(self.doc.title)
|
||||
|
||||
def validate(self):
|
||||
@@ -38,8 +38,8 @@ class DocType:
|
||||
where name=%s""", self.doc.blogger)
|
||||
|
||||
def on_update(self):
|
||||
website.utils.update_page_name(self.doc, self.doc.title)
|
||||
website.utils.delete_page_cache("writers")
|
||||
webnotes.webutils.update_page_name(self.doc, self.doc.title)
|
||||
webnotes.webutils.delete_page_cache("writers")
|
||||
|
||||
def send_emails(self):
|
||||
"""send emails to subscribers"""
|
||||
|
||||
@@ -17,5 +17,5 @@ class DocType:
|
||||
self.address = webnotes.bean("Address", self.doc.address).doc
|
||||
|
||||
def on_update(self):
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache("contact")
|
||||
@@ -9,7 +9,7 @@ class DocType:
|
||||
|
||||
def on_update(self):
|
||||
"""clear web cache"""
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache()
|
||||
|
||||
if self.doc.default_product_category:
|
||||
|
||||
@@ -27,7 +27,7 @@ class DocType:
|
||||
def validate(self):
|
||||
"""make custom css"""
|
||||
from jinja2 import Template
|
||||
from website.utils import get_hex_shade
|
||||
from webnotes.webutils import get_hex_shade
|
||||
import os
|
||||
|
||||
self.validate_colors()
|
||||
@@ -46,7 +46,7 @@ class DocType:
|
||||
from webnotes.sessions import clear_cache
|
||||
clear_cache('Guest')
|
||||
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache()
|
||||
|
||||
for f in ["small_font_size", "at_import", "heading_text_style"]:
|
||||
|
||||
@@ -22,11 +22,11 @@ class DocType():
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def autoname(self):
|
||||
from website.utils import page_name
|
||||
from webnotes.webutils import page_name
|
||||
self.doc.name = page_name(self.doc.title)
|
||||
|
||||
def on_update(self):
|
||||
from website.utils import update_page_name
|
||||
from webnotes.webutils import update_page_name
|
||||
update_page_name(self.doc, self.doc.title)
|
||||
self.if_home_clear_cache()
|
||||
|
||||
@@ -36,7 +36,7 @@ class DocType():
|
||||
from webnotes.sessions import clear_cache
|
||||
clear_cache('Guest')
|
||||
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache(self.doc.page_name)
|
||||
clear_cache('index')
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class DocType:
|
||||
make()
|
||||
|
||||
# clear web cache (for menus!)
|
||||
from website.utils import clear_cache
|
||||
from webnotes.webutils import clear_cache
|
||||
clear_cache()
|
||||
|
||||
def set_home_page(self):
|
||||
|
||||
Reference in New Issue
Block a user