body={
"destinationSpreadsheetId": spreadsheet_id
}).execute()
- # Rename each copied sheet to match original name
- rename_sheet(turb, spreadsheet_id, res['sheetId'],
- sheet["properties"]["title"])
+ # Rename each copied sheet to match the name from the template
+ sheet_name = sheet["properties"]["title"]
+ # Except for "Text" which we rename to the puzzle name
+ if sheet_name == "Text":
+ sheet_name = puzzle['name']
+ rename_sheet(turb, spreadsheet_id, res['sheetId'], sheet_name)
# Next, delete the blank sheet that's was created before the template
sheet_id = spreadsheet['sheets'][0]['properties']['sheetId']
# Insert some useful links into the sheet where expected
if 'url' in puzzle:
url_link = puzzle['url']
- url_text = "Original puzzle is at: {}".format(url_link)
+ url_text = "Original puzzle link"
spreadsheet_insert_data(
turb, spreadsheet_id, "B1:B1",
'=HYPERLINK("{}","{}")'.format(url_link, url_text))
if 'channel_url' in puzzle:
url_link = puzzle['channel_url']
- url_text = "Discussion for this puzzle is at: {}".format(url_link)
+ url_text = "Slack channel link"
spreadsheet_insert_data(
turb, spreadsheet_id, "B2:B2",
'=HYPERLINK("{}","{}")'.format(url_link, url_text))