fix: Disable caching for respond_as_web_page response (#8276)
* fix: Do not cache workflow approval confirmation page * fix: Make it readable * fix: Disable caching for respond_as_web_page * fix: Remove info about no_cache from docstring
This commit is contained in:
parent
2eebc463db
commit
84c3eb3d62
2 changed files with 9 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue