]> git.cworth.org Git - turbot/commitdiff
Fix to work with old puzzles that don't have a type attribute
authorCarl Worth <cworth@cworth.org>
Sat, 9 Jan 2021 22:39:39 +0000 (14:39 -0800)
committerCarl Worth <cworth@cworth.org>
Sun, 10 Jan 2021 06:25:49 +0000 (22:25 -0800)
Without this, commands like /state and /puzzle on old puzzle just die.

TODO
turbot/interaction.py
turbot/puzzle.py

diff --git a/TODO b/TODO
index d0aa1ba256903cecaa79d91ac14643eb12fc4d61..4aec8eaf70bf8c99789476a900846f5969657840 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,5 +1,6 @@
 Bugs that we want to fix before Hunt 2021
 -----------------------------------------
+
 • Move sheets into a subfolder
 
 • Add "/hunt new"
@@ -9,6 +10,9 @@ Bugs that we want to fix before Hunt 2021
 Ordered punch-list (aiming to complete by 2021-01-08)
 -----------------------------------------------------
 
+• Add an "archive channel" button that is provided out after a puzzle
+  has been solved.
+
 • Add tags to the puzzle edit interface
 
 • Make the /hunt command drop from the database any rounds that have 0
index 13b8ebf00fd6a31ceb60757b076ff86f30421dcd..f50a83495fee11761a27bcd3f1051ced3b493d35 100644 (file)
@@ -686,7 +686,7 @@ def puzzle(turb, body, args):
 
     # For a meta puzzle, also display the titles and solutions for all
     # puzzles in the same round.
-    if puzzle['type'] == 'meta':
+    if puzzle.get('type', 'plain') == 'meta':
         puzzles = hunt_puzzles_for_hunt_id(turb, puzzle['hunt_id'])
 
         # Drop this puzzle itself from the report
index e1e1bc2c6ed683fa8fe92962e4c476d59c433acf..08e86218738bbfba6cdeff598ded4acdfb758cec 100644 (file)
@@ -247,7 +247,7 @@ def puzzle_channel_name(puzzle):
         round = '-' + puzzle_id_from_name(puzzle['rounds'][0])
 
     meta = ''
-    if puzzle['type'] == 'meta':
+    if puzzle.get('type', 'plain') == 'meta':
         meta = '-m'
 
     # Note: We don't use puzzle['puzzle_id'] here because we're keeping