]> git.cworth.org Git - turbot/commitdiff
Turbot home: Use recently added hunt_id_index to find existing hunts
authorCarl Worth <cworth@cworth.org>
Thu, 31 Dec 2020 17:14:17 +0000 (10:14 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 31 Dec 2020 17:14:17 +0000 (10:14 -0700)
This fixes the home view to correctly use the new single-table schema to
find the list of available hunts. This view is now working to display
the names of active hunts a user belongs to.

(No puzzles are listed yet. That part of the home view still needs to be
brought up to date with the latest schema.)

turbot/events.py

index a118835d3b8eb0b42a5e04f6483abbebaf95a74b..9439a2396be6445ca9eb91c4b882c66b188f5bc1 100644 (file)
@@ -77,7 +77,9 @@ def home(turb, user_id):
 
     # Behave cleanly if there is no "turbot" table at all yet.
     try:
-        response = turb.table.scan()
+        response = turb.table.scan(
+            IndexName="hunt_id_index",
+        )
         hunts = response['Items']
     except Exception:
         hunts = []