Show More
@@ -682,14 +682,23 b' class Flash(_Flash):' | |||
|
682 | 682 | payloads = [] |
|
683 | 683 | messages = flash.pop_messages() |
|
684 | 684 | if messages: |
|
685 | for message in messages: | |
|
686 | payloads.append({ | |
|
687 |
' |
|
|
688 |
|
|
|
689 |
|
|
|
690 | 'force': 'true' | |
|
691 | } | |
|
692 |
|
|
|
685 | for message in messages: | |
|
686 | subdata = {} | |
|
687 | if hasattr(message.message, 'rsplit'): | |
|
688 | flash_data = message.message.rsplit('|DELIM|', 1) | |
|
689 | org_message = flash_data[0] | |
|
690 | if len(flash_data) > 1: | |
|
691 | subdata = json.loads(flash_data[1]) | |
|
692 | else: | |
|
693 | org_message = message.message | |
|
694 | payloads.append({ | |
|
695 | 'message': { | |
|
696 | 'message': u'{}'.format(org_message), | |
|
697 | 'level': message.category, | |
|
698 | 'force': True, | |
|
699 | 'subdata': subdata | |
|
700 | } | |
|
701 | }) | |
|
693 | 702 | return json.dumps(payloads) |
|
694 | 703 | |
|
695 | 704 | flash = Flash() |
General Comments 0
You need to be logged in to leave comments.
Login now