website fixes
This commit is contained in:
parent
e651648b1b
commit
cc54fd46bc
@ -7,7 +7,8 @@ def execute():
|
|||||||
add_website_manager()
|
add_website_manager()
|
||||||
from webnotes.modules import reload_doc
|
from webnotes.modules import reload_doc
|
||||||
from webnotes.model import delete_doc
|
from webnotes.model import delete_doc
|
||||||
|
|
||||||
|
reload_doc('setup', 'doctype', 'item_group')
|
||||||
delete_doc('Website', 'Module Def', 'Website')
|
delete_doc('Website', 'Module Def', 'Website')
|
||||||
reload_doc('website', 'Module Def', 'Website')
|
reload_doc('website', 'Module Def', 'Website')
|
||||||
reload_doc('website', 'Role', 'Website Manager')
|
reload_doc('website', 'Role', 'Website Manager')
|
||||||
@ -42,16 +43,17 @@ def execute():
|
|||||||
|
|
||||||
def create_home_page():
|
def create_home_page():
|
||||||
"""create a dummy home page"""
|
"""create a dummy home page"""
|
||||||
if not webnotes.conn.sql("""select name from `tabWeb Page` where name='home'""")
|
from webnotes.model.code import get_obj
|
||||||
d = Document('Web Page')
|
if not webnotes.conn.sql("""select name from `tabWeb Page` where name='home'"""):
|
||||||
d.title = 'Home'
|
d = Document('Web Page')
|
||||||
d.head_section = "<h1>Your Headline</h1>"
|
d.title = 'Home'
|
||||||
d.main_section = "<p>Some introduction about your company</p>"
|
d.head_section = "<h1>Your Headline</h1>"
|
||||||
d.side_section = "<p>Links to other pages</p>"
|
d.main_section = "<p>Some introduction about your company</p>"
|
||||||
d.save()
|
d.side_section = "<p>Links to other pages</p>"
|
||||||
obj = get_obj(doc = d)
|
d.save()
|
||||||
obj.validate()
|
obj = get_obj(doc = d)
|
||||||
obj.doc.save()
|
obj.validate()
|
||||||
|
obj.doc.save()
|
||||||
|
|
||||||
def add_website_manager():
|
def add_website_manager():
|
||||||
"""add website manager to system manager"""
|
"""add website manager to system manager"""
|
||||||
|
@ -236,4 +236,4 @@
|
|||||||
'print_hide': 1,
|
'print_hide': 1,
|
||||||
'report_hide': 1
|
'report_hide': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import webnotes
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
self.doc, self.doclist = d, dl
|
self.doc, self.doclist = d, dl
|
||||||
@ -24,4 +26,14 @@ class DocType:
|
|||||||
|
|
||||||
website.utils.add_guest_access_to_page(p.name)
|
website.utils.add_guest_access_to_page(p.name)
|
||||||
self.doc.page_name = p.name
|
self.doc.page_name = p.name
|
||||||
del self.doc.fields['long_description_html']
|
del self.doc.fields['long_description_html']
|
||||||
|
self.make_item_group_active()
|
||||||
|
|
||||||
|
|
||||||
|
def make_item_group_active(self):
|
||||||
|
"""show item group in website"""
|
||||||
|
if self.doc.published:
|
||||||
|
from webnotes.model.doc import Document
|
||||||
|
ig = Document('Item Group', webnotes.conn.get_value('Item', self.doc.item, 'item_group'))
|
||||||
|
ig.show_in_website = 1
|
||||||
|
ig.save()
|
||||||
|
18
wnf.py
18
wnf.py
@ -68,6 +68,10 @@ def run():
|
|||||||
from webnotes.db import Database
|
from webnotes.db import Database
|
||||||
import webnotes.modules.patch_handler
|
import webnotes.modules.patch_handler
|
||||||
|
|
||||||
|
# connect
|
||||||
|
if options.db_name is not None:
|
||||||
|
webnotes.connect(options.db_name)
|
||||||
|
|
||||||
# build
|
# build
|
||||||
if options.build:
|
if options.build:
|
||||||
import build.project
|
import build.project
|
||||||
@ -99,19 +103,11 @@ def run():
|
|||||||
os.system('git commit -a -m "%s"' % options.push[2])
|
os.system('git commit -a -m "%s"' % options.push[2])
|
||||||
os.system('git push %s %s' % (options.push[0], options.push[1]))
|
os.system('git push %s %s' % (options.push[0], options.push[1]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# patch
|
# patch
|
||||||
elif options.patch_list:
|
elif options.patch_list:
|
||||||
# clear log
|
# clear log
|
||||||
webnotes.modules.patch_handler.log_list = []
|
webnotes.modules.patch_handler.log_list = []
|
||||||
|
|
||||||
# connect to db
|
|
||||||
if options.db_name is not None:
|
|
||||||
webnotes.connect(options.db_name)
|
|
||||||
else:
|
|
||||||
webnotes.connect()
|
|
||||||
|
|
||||||
# run individual patches
|
# run individual patches
|
||||||
for patch in options.patch_list:
|
for patch in options.patch_list:
|
||||||
webnotes.modules.patch_handler.run_single(\
|
webnotes.modules.patch_handler.run_single(\
|
||||||
@ -129,6 +125,10 @@ def run():
|
|||||||
elif options.run_latest:
|
elif options.run_latest:
|
||||||
webnotes.modules.patch_handler.run_all()
|
webnotes.modules.patch_handler.run_all()
|
||||||
print '\n'.join(webnotes.modules.patch_handler.log_list)
|
print '\n'.join(webnotes.modules.patch_handler.log_list)
|
||||||
|
|
||||||
|
# print messages
|
||||||
|
if webnotes.message_log:
|
||||||
|
print '\n'.join(webnotes.message_log)
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
run()
|
run()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user