X-Git-Url: https://git.cworth.org/git?p=turbot;a=blobdiff_plain;f=turbot%2Fevents.py;h=adf7c9e04853f0a3561bf96749af14e05b4157ee;hp=8f9f12c4d4d130c45ed57f9dafa19b258587cf82;hb=5f54f1ee53b8ae1b9d93df3f56c6a992f1d1bf0a;hpb=c267061f2ba8826b35bb3f0a467b7585838fccf0 diff --git a/turbot/events.py b/turbot/events.py index 8f9f12c..adf7c9e 100644 --- a/turbot/events.py +++ b/turbot/events.py @@ -191,6 +191,10 @@ def puzzle_channel_created(turb, channel_name, channel_id): .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' @@ -200,7 +204,7 @@ def puzzle_channel_created(turb, channel_name, channel_id): 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']