From 94aae1f0a40594910ee5661b417e22ab7936f2b6 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 22 Oct 2020 03:36:51 -0700 Subject: [PATCH] Drop the hunt_channel_id from the metadata passed in the puzzle modal We've now got another handoff, from the puzzle modal's submission handler to a separate channel_created event before the hunt's channel_id is needed. And by then we've lost the context of this private_metadata, (so the current code scans through the database 'hunts' table to find the ID). Given all that, we can drop this unused field from the metadata. --- turbot/interaction.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/turbot/interaction.py b/turbot/interaction.py index 3bdd794..b106196 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -228,7 +228,6 @@ def puzzle(turb, body, args): "type": "modal", "private_metadata": json.dumps({ "hunt_id": hunt_id, - "hunt_channel_id": channel_id }), "title": {"type": "plain_text", "text": "New Puzzle"}, "submit": { "type": "plain_text", "text": "Create" }, @@ -263,7 +262,6 @@ def puzzle_submission(turb, payload, metadata): meta = json.loads(metadata) hunt_id = meta['hunt_id'] - hunt_channel_id = meta['hunt_channel_id'] state = payload['view']['state']['values'] name = state['name']['name']['value'] -- 2.45.2