From 1b923fa3cf6906ed976af1abb0765048302390c0 Mon Sep 17 00:00:00 2001 From: Aaron Suarez Date: Mon, 21 Oct 2019 09:31:33 -0500 Subject: [PATCH] Keep message in details form --- pybot/endpoints/slack/actions/mentor_request.py | 4 +++- pybot/endpoints/slack/utils/action_messages.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pybot/endpoints/slack/actions/mentor_request.py b/pybot/endpoints/slack/actions/mentor_request.py index 1e51c66..b44cd56 100644 --- a/pybot/endpoints/slack/actions/mentor_request.py +++ b/pybot/endpoints/slack/actions/mentor_request.py @@ -53,8 +53,10 @@ async def mentor_details_submit(action: Action, app: SirBot): async def open_details_dialog(action: Action, app: SirBot): + request = MentorRequest(action) + cur_details = request.details trigger_id = action["trigger_id"] - response = {"trigger_id": trigger_id, "dialog": mentor_details_dialog(action)} + response = {"trigger_id": trigger_id, "dialog": mentor_details_dialog(action, cur_details)} await app.plugins["slack"].api.query(methods.DIALOG_OPEN, response) diff --git a/pybot/endpoints/slack/utils/action_messages.py b/pybot/endpoints/slack/utils/action_messages.py index 3a1e4c5..f1c97a3 100644 --- a/pybot/endpoints/slack/utils/action_messages.py +++ b/pybot/endpoints/slack/utils/action_messages.py @@ -252,7 +252,7 @@ def build_report_message(slack_id, details, message_details): return {"text": message, "channel": MODERATOR_CHANNEL, "attachments": attachment} -def mentor_details_dialog(action): +def mentor_details_dialog(action, cur_details): trigger_id = action["trigger_id"] ts = action["message"]["ts"] @@ -269,6 +269,7 @@ def mentor_details_dialog(action): "name": "details", "placeholder": "", "required": False, + "value": cur_details } ], }