From 77b9bc5bfe73dd68b5c38d3657fcd5118244e6d5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 22 Nov 2013 12:33:16 +0530 Subject: [PATCH] [minor] [website] [fix] table of contents recursion --- webnotes/webutils.py | 3 +-- website/doctype/web_page/web_page.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/webnotes/webutils.py b/webnotes/webutils.py index 4a78361573..a6ab8590c4 100644 --- a/webnotes/webutils.py +++ b/webnotes/webutils.py @@ -213,8 +213,7 @@ def is_signup_enabled(): return webnotes.local.is_signup_enabled -from webnotes.model.controller import DocListController -class WebsiteGenerator(DocListController): +class WebsiteGenerator(object): def setup_generator(self): self._website_config = webnotes.conn.get_values("Website Sitemap Config", {"ref_doctype": self.doc.doctype}, "*")[0] diff --git a/website/doctype/web_page/web_page.py b/website/doctype/web_page/web_page.py index d8be7b5599..864ca9490c 100644 --- a/website/doctype/web_page/web_page.py +++ b/website/doctype/web_page/web_page.py @@ -5,11 +5,9 @@ from __future__ import unicode_literals import webnotes from webnotes.webutils import WebsiteGenerator from webnotes import _ +from webnotes.model.controller import DocListController -class DocType(WebsiteGenerator): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - +class DocType(DocListController, WebsiteGenerator): def autoname(self): from webnotes.webutils import cleanup_page_name self.doc.name = cleanup_page_name(self.doc.title)