From 42d0d334446606274636324227e4736ebf242670 Mon Sep 17 00:00:00 2001 From: lsabor Date: Thu, 22 Aug 2024 09:36:26 -0700 Subject: [PATCH] switch queryset to list to support negative indexing --- posts/services/subscriptions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/posts/services/subscriptions.py b/posts/services/subscriptions.py index e398051db8..97fb0cae9f 100644 --- a/posts/services/subscriptions.py +++ b/posts/services/subscriptions.py @@ -162,9 +162,11 @@ def notify_post_cp_change(post: Post): Q(post=post) | Q(group__post=post) ).prefetch_related("user_forecasts") forecast_history = { - question: AggregateForecast.objects.filter( - question=question, - method=AggregationMethod.RECENCY_WEIGHTED, + question: list( + AggregateForecast.objects.filter( + question=question, + method=AggregationMethod.RECENCY_WEIGHTED, + ) ) for question in questions }