X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=turbot%2Finteraction.py;h=c0aff61dbc7412bbfb895f6cbec2336432bbc0a1;hb=5a1bf7d220db5d91db52dce48bdf29485eae105b;hp=b22016107df99ae5127e4101d6cbe87abc0c4a3e;hpb=7151e2b039f92dc9904dc4b9e77a22f2d089b020;p=turbot diff --git a/turbot/interaction.py b/turbot/interaction.py index b220161..c0aff61 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -776,8 +776,8 @@ def new_puzzle_submission(turb, payload, metadata): } ) - # Insert the newly-created puzzle into the database - item={ + # Construct a puzzle dict + puzzle = { "hunt_id": hunt_id, "SK": "puzzle-{}".format(puzzle_id), "puzzle_id": puzzle_id, @@ -788,10 +788,12 @@ def new_puzzle_submission(turb, payload, metadata): "type": puzzle_type } if url: - item['url'] = url + puzzle['url'] = url if rounds: - item['rounds'] = rounds - turb.table.put_item(Item=item) + puzzle['rounds'] = rounds + + # Insert the newly-created puzzle into the database + turb.table.put_item(Item=puzzle) return lambda_ok