diff --git a/frappe/__init__.py b/frappe/__init__.py index 650ae7b71f..741aae1b06 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -1162,7 +1162,7 @@ def respond_as_web_page(title, html, success=None, http_status_code=None, :param context: web template context :param indicator_color: color of indicator in title :param primary_action: route on primary button (default is `/`) - :param primary_label: label on primary button (defaut is "Home") + :param primary_label: label on primary button (default is "Home") :param fullpage: hide header / footer :param width: Width of message in pixels :param template: Optionally pass view template @@ -1171,6 +1171,8 @@ def respond_as_web_page(title, html, success=None, http_status_code=None, local.message = html local.response['type'] = 'page' local.response['route'] = template + local.no_cache = 1 + if http_status_code: local.response['http_status_code'] = http_status_code diff --git a/frappe/workflow/doctype/workflow_action/workflow_action.py b/frappe/workflow/doctype/workflow_action/workflow_action.py index 53ab1073f9..f32b1dfc03 100644 --- a/frappe/workflow/doctype/workflow_action/workflow_action.py +++ b/frappe/workflow/doctype/workflow_action/workflow_action.py @@ -94,7 +94,8 @@ def confirm_action(doctype, docname, user, action): return_success_page(newdoc) # reset session user - frappe.set_user(logged_in_user) + if logged_in_user == 'Guest': + frappe.set_user(logged_in_user) def return_success_page(doc): frappe.respond_as_web_page(_("Success"), @@ -116,9 +117,10 @@ def return_action_confirmation_page(doc, action, action_link, alert_doc_change=F template_params['pdf_link'] = get_pdf_link(doc.get('doctype'), doc.get('name')) - frappe.respond_as_web_page(None, None, - indicator_color="blue", - template="confirm_workflow_action", + frappe.respond_as_web_page(title=None, + html=None, + indicator_color='blue', + template='confirm_workflow_action', context=template_params) def return_link_expired_page(doc, doc_workflow_state):