]> git.cworth.org Git - turbot/commitdiff
Name sheet based on puzzle name, not puzzle channel ID
authorCarl Worth <cworth@cworth.org>
Fri, 23 Oct 2020 13:47:38 +0000 (06:47 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 23 Oct 2020 13:47:38 +0000 (06:47 -0700)
We don't have the same restrictions on the sheet name that we have on
the channel name, so let the original name go through.

turbot/events.py

index 7a8654e837fad7d6a1cbf447c1fa158fdb907197..feb0514a7a841c5a36ec8ca248ce1b814924f4e8 100644 (file)
@@ -246,7 +246,7 @@ def puzzle_channel_created(turb, puzzle_channel_name, puzzle_channel_id):
     puzzle_table.put_item(Item=item)
 
     # Create a sheet for the puzzle
-    sheet = turbot.sheets.sheets_create_for_puzzle(turb, puzzle_channel_name)
+    sheet = turbot.sheets.sheets_create_for_puzzle(turb, item['name'])
 
     # Update the database with the URL of the sheet
     item['sheet_url'] = sheet['url']
@@ -255,6 +255,7 @@ def puzzle_channel_created(turb, puzzle_channel_name, puzzle_channel_id):
     # Get the new sheet_url into the channel description
     set_channel_description(turb, item)
 
+    # Finally, lookup and invite all users from this hunt to this new puzzle
     hunts_table = turb.db.Table('hunts')
     response = hunts_table.scan(
         FilterExpression='hunt_id = :hunt_id',