]> git.cworth.org Git - turbot/commitdiff
Fix arguments to HYPERLINK
authorjustin melvin <jmelvinprime@gmail.com>
Sat, 28 Nov 2020 00:03:33 +0000 (16:03 -0800)
committerjustin melvin <jmelvinprime@gmail.com>
Sat, 28 Nov 2020 00:03:33 +0000 (16:03 -0800)
turbot/sheets.py

index 0ed6847f8af2bd6747cbf6b7b4c1ad24199a728c..0b2cb5ed38d41e52d9c07b417d753c5ae725dc7e 100644 (file)
@@ -39,14 +39,18 @@ def sheets_create_for_puzzle(turb, puzzle):
     new_sheet = sheets_create(turb, puzzle['name'])
 
     # Insert some useful links into the sheet
+    url_link=''
     if 'url' in puzzle:
         url_text = "Original puzzle is at: {}".format(puzzle['url'])
+        url_link = puzzle['url']
     else:
         url_text = ''
 
+    channel_url_link = ''
     if 'channel_url' in puzzle:
         channel_url_text = "Discussion for this puzzle is at: {}".format(
             puzzle['channel_url'])
+        channel_url_link = puzzle['channel_url']
     else:
         channel_url_text = ''
 
@@ -57,7 +61,7 @@ def sheets_create_for_puzzle(turb, puzzle):
         insertDataOption='INSERT_ROWS',
         body={
             'range': 'A1:A2',
-            'values': [['=HYPERLINK('+url_text+')'], ['=HYPERLINK('+channel_url_text+')']]
+            'values': [['=HYPERLINK('+url_link+','+url_text+')'], ['=HYPERLINK('+channel_url_link+','+channel_url_text+')']]
         }).execute()
 
     # Copy some sheets from the Template spreadsheet