]> git.cworth.org Git - turbot/blobdiff - turbot/events.py
Turbot home: Report "you do not belong to any hunts" if that is the case
[turbot] / turbot / events.py
index 64430e5527a0a72395c3a818223f2eb115494dcf..a118835d3b8eb0b42a5e04f6483abbebaf95a74b 100644 (file)
@@ -91,11 +91,20 @@ def home(turb, user_id):
             continue
         hunt_blocks += hunt_block(turb, hunt)
 
+    if len(hunt_blocks):
+        hunt_blocks = [
+            section_block(text_block("*Hunts you belong to*")),
+            divider_block(),
+            * hunt_blocks
+        ]
+    else:
+        hunt_blocks = [
+            section_block(text_block("You do not belong to any hunts"))
+        ]
+
     return {
         "type": "home",
         "blocks": [
-            section_block(text_block("*Hunts you belong to*")),
-            divider_block(),
             * hunt_blocks,
             actions_block(button_block("New hunt", "new_hunt"))
         ]