]> git.cworth.org Git - turbot/blobdiff - turbot/events.py
Home: Update query for finding puzzles to new all-one-table schema
[turbot] / turbot / events.py
index 9439a2396be6445ca9eb91c4b882c66b188f5bc1..bbc00b63bccf8b74c578ed0f3e4d6e3372c91e8e 100644 (file)
@@ -58,7 +58,12 @@ def hunt_block(turb, hunt):
     hunt_id = hunt['hunt_id']
     channel_id = hunt['channel_id']
 
-    response = turb.db.Table(hunt_id).scan()
+    response = turb.table.query(
+        KeyConditionExpression=(
+            Key('PK').eq('hunt-{}'.format(hunt_id)) &
+            Key('SK').begins_with('puzzle-')
+        )
+    )
     puzzles = response['Items']
 
     hunt_text = "*<{}|{}>*".format(channel_url(channel_id), name)