[fix] add indicator parameter to redirect_to_message (#2717)
This commit is contained in:
parent
a824576bce
commit
0be79e6fe3
1 changed files with 6 additions and 1 deletions
|
|
@ -1039,7 +1039,7 @@ def respond_as_web_page(title, html, success=None, http_status_code=None,
|
|||
|
||||
local.response['context'] = context
|
||||
|
||||
def redirect_to_message(title, html, http_status_code=None, context=None):
|
||||
def redirect_to_message(title, html, http_status_code=None, context=None, indicator=None):
|
||||
"""Redirects to /message?id=random
|
||||
Similar to respond_as_web_page, but used to 'redirect' and show message pages like success, failure, etc. with a detailed message
|
||||
|
||||
|
|
@ -1063,6 +1063,11 @@ def redirect_to_message(title, html, http_status_code=None, context=None):
|
|||
'message': html
|
||||
})
|
||||
|
||||
if indicator:
|
||||
message['context'].update({
|
||||
"indicator_color": indicator
|
||||
})
|
||||
|
||||
cache().set_value("message_id:{0}".format(message_id), message, expires_in_sec=60)
|
||||
location = '/message?id={0}'.format(message_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue