]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Fix to work with old puzzles that don't have a type attribute
[turbot] / turbot / interaction.py
index ec64706658f3126bfc1974921d12e4cdece78ffe..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
@@ -927,8 +927,8 @@ def tag(turb, body, args):
     tag = tag.upper()
 
     # Reject a tag that is not alphabetic or underscore A-Z_
-    if not re.match(r'^[A-Z_]*$', tag):
-        return bot_reply("Sorry, tags can only contain letters "
+    if not re.match(r'^[A-Z0-9_]*$', tag):
+        return bot_reply("Sorry, tags can only contain letters, numbers, "
                          + "and the underscore character.")
 
     if action == 'remove':