diff --git a/webnotes/__init__.py b/webnotes/__init__.py index 35ee5b44f1..ba32c471f5 100644 --- a/webnotes/__init__.py +++ b/webnotes/__init__.py @@ -563,7 +563,8 @@ def get_jenv(): jenv.globals.update({ "webnotes": sys.modules[__name__], - "webnotes.utils": webnotes.utils + "webnotes.utils": webnotes.utils, + "_": _ }) return jenv diff --git a/webnotes/core/doctype/communication/communication.py b/webnotes/core/doctype/communication/communication.py index def068ba59..afc2e72d3d 100644 --- a/webnotes/core/doctype/communication/communication.py +++ b/webnotes/core/doctype/communication/communication.py @@ -12,7 +12,7 @@ from webnotes.utils.email_lib.email_body import get_email from webnotes.utils.email_lib.smtp import send class DocType(): - def __init__(self, doc, doclist=[]): + def __init__(self, doc, doclist=None): self.doc = doc self.doclist = doclist diff --git a/webnotes/core/doctype/profile/profile.py b/webnotes/core/doctype/profile/profile.py index e39cf97830..4b1216aa53 100644 --- a/webnotes/core/doctype/profile/profile.py +++ b/webnotes/core/doctype/profile/profile.py @@ -305,6 +305,8 @@ def update_password(new_password, key=None, old_password=None): webnotes.conn.set_value("Profile", user, "reset_password_key", "") + webnotes.local.login_manager.logout() + return _("Password Updated") @webnotes.whitelist(allow_guest=True) diff --git a/webnotes/templates/generators/blog_post.py b/webnotes/templates/generators/blog_post.py index 44355c9c41..8d0fe2e554 100644 --- a/webnotes/templates/generators/blog_post.py +++ b/webnotes/templates/generators/blog_post.py @@ -6,13 +6,12 @@ from __future__ import unicode_literals import markdown2 import webnotes from webnotes.utils import global_date_format, get_fullname, cint -from webnotes.webutils import render_blocks doctype = "Blog Post" condition_field = "published" def get_context(context): - blog_post = webnotes.doc(context.ref_doctype, context.docname) + blog_post = context.bean.doc # this is for double precaution. usually it wont reach this code if not published if not cint(blog_post.published): @@ -35,9 +34,8 @@ def get_context(context): from `tabComment` where comment_doctype="Blog Post" and comment_docname=%s order by creation""", (blog_post.name,), as_dict=1) or [] - blog_post.fields.update(context) - return render_blocks(blog_post.fields) + return blog_post.fields @webnotes.whitelist(allow_guest=True) def get_blog_list(start=0, by=None, category=None): diff --git a/webnotes/templates/generators/web_page.py b/webnotes/templates/generators/web_page.py index f724042e90..28d8bb4715 100644 --- a/webnotes/templates/generators/web_page.py +++ b/webnotes/templates/generators/web_page.py @@ -3,14 +3,13 @@ from __future__ import unicode_literals import webnotes -from webnotes.webutils import render_blocks from webnotes.website.doctype.website_slideshow.website_slideshow import get_slideshow doctype = "Web Page" condition_field = "published" def get_context(context): - web_page = webnotes.bean(context.ref_doctype, context.docname) + web_page = context.bean if web_page.doc.slideshow: web_page.doc.fields.update(get_slideshow(web_page)) @@ -36,7 +35,7 @@ def get_context(context): web_page.doc.fields.update(context) - return render_blocks(web_page.doc.fields) + return web_page.doc.fields def get_breadcrumbs(web_page): breadcrumbs = [] diff --git a/webnotes/templates/generators/website_group.html b/webnotes/templates/generators/website_group.html index 8b49ca56b6..dbbed07c94 100644 --- a/webnotes/templates/generators/website_group.html +++ b/webnotes/templates/generators/website_group.html @@ -7,14 +7,7 @@ {%- endif -%} {% endblock %} -{% block breadcrumbs %} - -{% endblock %} +{% block breadcrumbs %}{% include "templates/includes/breadcrumbs.html" %}{% endblock %} {% block content %}