]> git.cworth.org Git - turbot/blobdiff - turbot/events.py
Use empty list instead of empty tuple in a few places
[turbot] / turbot / events.py
index 508e8d95da15caa666cac268bb25efc14660945d..25c83233865fee9063d91dc205e23f8fc761440a 100644 (file)
@@ -1,7 +1,7 @@
 from turbot.blocks import (
     section_block, text_block, button_block, actions_block, divider_block
 )
-from turbot.hunt import hunt_blocks, find_hunt_for_hunt_id
+from turbot.hunt import find_hunt_for_hunt_id
 from turbot.sheets import (
     sheets_create, sheets_create_for_puzzle, sheets_create_folder
 )
@@ -47,7 +47,7 @@ def home(turb, user_id):
             continue
         if user_id in slack_channel_members(turb.slack_client,
                                             hunt['channel_id']):
-            my_hunt_blocks += hunt_blocks(turb, hunt, puzzle_status='all')
+            my_hunt_blocks.append(hunt_link_block(turb, hunt))
         else:
             available_hunt_blocks.append(hunt_link_block(turb, hunt))
 
@@ -58,9 +58,9 @@ def home(turb, user_id):
             * my_hunt_blocks
         ]
     else:
-        my_hunt_blocks = [
+        my_hunt_blocks.append([
             section_block(text_block("You do not belong to any hunts"))
-        ]
+        ])
 
     if len(available_hunt_blocks):
         available_hunt_blocks = [
@@ -125,8 +125,17 @@ def hunt_channel_created(turb, channel_name, channel_id):
         "Welcome to the channel for the {} hunt! ".format(hunt['name'])
         + "Please wait a moment or two while I create some backend resources.")
 
-    # Create a new folder within Google drive for the hunt
-    hunt['folder_id'] = sheets_create_folder(turb, hunt['hunt_id'])
+    # Create a new folder within Google drive for the hunt in two parts:
+
+    # ... first, a top-level folder named for the hunt
+    hunt_folder = sheets_create_folder(turb, hunt['hunt_id'])
+
+    # ... second, a folder within that named "turbot"
+    #
+    # The concept here is that non-turbot related content could
+    # be placed adjacent to the turbot folder.
+    hunt['folder_id'] = sheets_create_folder(turb, "turbot",
+                                             parents = [hunt_folder])
 
     # Create a sheet for the hunt
     sheet = sheets_create(turb, hunt['name'], hunt['folder_id'])