This will be handy for calling some puzzle.py functions that expect a dict.
- # 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,
"hunt_id": hunt_id,
"SK": "puzzle-{}".format(puzzle_id),
"puzzle_id": puzzle_id,
"type": puzzle_type
}
if url:
"type": puzzle_type
}
if url:
- 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)