]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Fix puzzle edit form in the case of no existing rounds in the hunt yet
[turbot] / turbot / interaction.py
index 4a36b71b9e074eead82ce4fbb1fbd51643825e5a..cbb8befe2bcb3eb4ebf3df0d7f3165fcf1f5e128 100644 (file)
@@ -267,10 +267,11 @@ def edit_puzzle_submission(turb, payload, metadata):
         puzzle['type'] = 'meta'
     else:
         puzzle['type'] = 'plain'
-    rounds = [option['value'] for option in
-              state['rounds']['rounds']['selected_options']]
-    if rounds:
-        puzzle['rounds'] = rounds
+    if 'rounds' in state:
+        rounds = [option['value'] for option in
+                  state['rounds']['rounds']['selected_options']]
+        if rounds:
+            puzzle['rounds'] = rounds
     new_rounds = state['new_rounds']['new_rounds']['value']
     puzzle_state = state['state']['state']['value']
     if puzzle_state:
@@ -501,7 +502,6 @@ def new_hunt_command(turb, body):
 def new_hunt_button(turb, payload):
     """Handler for the action of user pressing the new_hunt button"""
 
-    print("In new_hunt_button with payload of: " + str(payload))
     trigger_id = payload['trigger_id']
 
     return new_hunt(turb, trigger_id)