From 849812bca3e5ad1a697483c651f5618e99fb6d35 Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Tue, 9 Jan 2024 16:40:46 +0000 Subject: [PATCH] handle multiple response messages --- bento_beacon/utils/beacon_response.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bento_beacon/utils/beacon_response.py b/bento_beacon/utils/beacon_response.py index f1d70b4a..7b96781d 100644 --- a/bento_beacon/utils/beacon_response.py +++ b/bento_beacon/utils/beacon_response.py @@ -10,10 +10,14 @@ def init_response_data(): g.response_data = {} g.response_info = {} - -# TODO: handle multiple messages def add_info_to_response(info): - g.response_info["message"] = info + add_message({"description": info, "level": "info"}) + + +def add_message(message_obj): + messages = g.response_info.get("messages", []) + messages.append(message_obj) + g.response_info["messages"] = messages def add_stats_to_response(ids):