]> git.cworth.org Git - turbot/blobdiff - turbot/puzzle.py
Wire up a function to handle the edit_puzzle button
[turbot] / turbot / puzzle.py
index 3c85df487f7298a42370f13bc5e91d1553dbb1e5..81e0630f88c08416097ec55aa972ccde18387164 100644 (file)
@@ -69,10 +69,15 @@ def puzzle_blocks(puzzle):
         ', '.join(links), state_str
     )
 
+    # Combining hunt ID and puzzle ID together here is safe because
+    # both IDs are restricted to not contain a hyphen, (see
+    # valid_id_re in interaction.py)
+    hunt_and_puzzle = "{}-{}".format(puzzle['hunt_id'], puzzle['puzzle_id'])
+
     return [
         accessory_block(
             section_block(text_block(puzzle_text)),
-            button_block("✏", puzzle['puzzle_id'])
+            button_block("✏", "edit_puzzle", hunt_and_puzzle)
         )
     ]