.format(channel_id, puzzle['sheet_url']))
return lambda_success
+ # We need hunt from the database to know which folder to create
+ # the sheet in.
+ hunt = find_hunt_for_hunt_id(turb, puzzle['hunt_id'])
+
# Before launching into sheet creation, indicate that we're doing this
# in the database. This way, if we take too long to create the sheet
# and Slack retries the event, that next event will see this 'pending'
turb.table.put_item(Item=puzzle)
# Create a sheet for the puzzle
- sheet = sheets_create_for_puzzle(turb, puzzle)
+ sheet = sheets_create_for_puzzle(turb, puzzle, hunt['folder_id'])
# Update the database with the URL of the sheet
puzzle['sheet_url'] = sheet['url']