Browse Source

[fix] add indicator parameter to redirect_to_message (#2717)

version-14
Saurabh 8 years ago
committed by Rushabh Mehta
parent
commit
0be79e6fe3
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      frappe/__init__.py

+ 6
- 1
frappe/__init__.py View File

@@ -1039,7 +1039,7 @@ def respond_as_web_page(title, html, success=None, http_status_code=None,


local.response['context'] = context 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 """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 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 'message': html
}) })


if indicator:
message['context'].update({
"indicator_color": indicator
})

cache().set_value("message_id:{0}".format(message_id), message, expires_in_sec=60) cache().set_value("message_id:{0}".format(message_id), message, expires_in_sec=60)
location = '/message?id={0}'.format(message_id) location = '/message?id={0}'.format(message_id)




Loading…
Cancel
Save