From: Carl Worth Date: Thu, 22 Oct 2020 10:36:51 +0000 (-0700) Subject: Drop the hunt_channel_id from the metadata passed in the puzzle modal X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=94aae1f0a40594910ee5661b417e22ab7936f2b6;p=turbot 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. --- 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']