From ef114773a6f420c507ed13b4729cbdd74c76661f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 22 Nov 2013 12:21:19 +0530 Subject: [PATCH] [minor] [website] brand_html --- patches/1311/p05_website_brand_html.py | 16 ++++++++++++++++ patches/patch_list.py | 1 + setup/doctype/company/company.py | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 patches/1311/p05_website_brand_html.py diff --git a/patches/1311/p05_website_brand_html.py b/patches/1311/p05_website_brand_html.py new file mode 100644 index 0000000000..04d2f83aaf --- /dev/null +++ b/patches/1311/p05_website_brand_html.py @@ -0,0 +1,16 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes + +def execute(): + bean = webnotes.bean("Website Settings") + for company in webnotes.conn.sql_list("select name from `tabCompany`"): + if bean.doc.banner_html == ("""

""" + company + "

"): + bean.doc.banner_html = None + if not bean.doc.brand_html: + bean.doc.brand_html = company + + bean.save() + break \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 93b97336c1..ad7bd4f095 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -251,4 +251,5 @@ patch_list = [ "execute:webnotes.bean('Style Settings').save() #2013-11-20", "execute:webnotes.get_module('website.doctype.website_sitemap_config.website_sitemap_config').rebuild_website_sitemap_config()", "patches.1311.p04_update_comments", + "patches.1311.p05_website_brand_html", ] \ No newline at end of file diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py index 3b1670d4f2..ec8861e961 100644 --- a/setup/doctype/company/company.py +++ b/setup/doctype/company/company.py @@ -80,7 +80,7 @@ class DocType: # update in home page in settings website_settings = webnotes.bean("Website Settings", "Website Settings") website_settings.doc.home_page = webpage.doc.name - website_settings.doc.brand_html = "{}".format(self.doc.name) + website_settings.doc.brand_html = self.doc.name website_settings.doc.copyright = self.doc.name website_settings.doclist.append({ "doctype": "Top Bar Item",