浏览代码

Fix in Get Sitemap Options

version-14
Anand Doshi 11 年前
父节点
当前提交
b5585e23ec
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      webnotes/webutils.py

+ 3
- 3
webnotes/webutils.py 查看文件

@@ -116,16 +116,16 @@ def get_context(path):
def get_sitemap_options(path): def get_sitemap_options(path):
sitemap_options = None sitemap_options = None
cache_key = "sitemap_options:{}".format(path) cache_key = "sitemap_options:{}".format(path)
if can_cache(): if can_cache():
sitemap_options = webnotes._dict(webnotes.cache().get_value(cache_key))
sitemap_options = webnotes.cache().get_value(cache_key)


if not sitemap_options: if not sitemap_options:
sitemap_options = build_sitemap_options(path) sitemap_options = build_sitemap_options(path)
if can_cache(sitemap_options.no_cache): if can_cache(sitemap_options.no_cache):
webnotes.cache().set_value(cache_key, sitemap_options) webnotes.cache().set_value(cache_key, sitemap_options)
return sitemap_options
return webnotes._dict(sitemap_options)
def build_sitemap_options(path): def build_sitemap_options(path):
sitemap_options = webnotes.doc("Website Sitemap", path).fields sitemap_options = webnotes.doc("Website Sitemap", path).fields


正在加载...
取消
保存