Skip to content

Commit

Permalink
Merge pull request #13842 from pratu16x7/hotfix
Browse files Browse the repository at this point in the history
[fix] setup_website, fixes #11143
  • Loading branch information
pratu16x7 committed Apr 30, 2018
2 parents 30304e6 + 9b2078f commit 53c9b63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
3 changes: 1 addition & 2 deletions erpnext/setup/setup_wizard/operations/company_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def create_logo(args):
"<img src='{0}' style='max-width: 40px; max-height: 25px;'> {1}".format(fileurl, args.get("company_name") ))

def create_website(args):
if args.get('setup_website'):
website_maker(args)
website_maker(args)

def get_fy_details(fy_start_date, fy_end_date):
start_year = getdate(fy_start_date).year
Expand Down
20 changes: 12 additions & 8 deletions erpnext/setup/setup_wizard/operations/default_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, args):
self.args = args
self.company = args.company_name
self.tagline = args.company_tagline
self.user = args.name
self.user = args.get('email')
self.make_web_page()
self.make_website_settings()
self.make_blog()
Expand Down Expand Up @@ -50,6 +50,17 @@ def make_website_settings(self):
website_settings.save()

def make_blog(self):
blog_category = frappe.get_doc({
"doctype": "Blog Category",
"category_name": "general",
"published": 1,
"title": _("General")
}).insert()

if not self.user:
# Admin setup
return

blogger = frappe.new_doc("Blogger")
user = frappe.get_doc("User", self.user)
blogger.user = self.user
Expand All @@ -58,13 +69,6 @@ def make_blog(self):
blogger.avatar = user.user_image
blogger.insert()

blog_category = frappe.get_doc({
"doctype": "Blog Category",
"category_name": "general",
"published": 1,
"title": _("General")
}).insert()

frappe.get_doc({
"doctype": "Blog Post",
"title": "Welcome",
Expand Down

0 comments on commit 53c9b63

Please sign in to comment.