fixed add junior multiple device notification issue, changed send multiple user notification method, modified add fcm token method

This commit is contained in:
abutalib-kiwi
2023-08-28 15:36:24 +05:30
parent f424c99478
commit 5e17edcf3f
5 changed files with 28 additions and 31 deletions

View File

@ -128,7 +128,7 @@ class AnalyticsViewSet(GenericViewSet):
:param request:
:return:
"""
queryset = JuniorPoints.objects.prefetch_related('junior', 'junior__auth').annotate(rank=Window(
queryset = JuniorPoints.objects.select_related('junior', 'junior__auth').annotate(rank=Window(
expression=Rank(),
order_by=[F('total_points').desc(), 'junior__created_at']
)).order_by('-total_points', 'junior__created_at')
@ -199,7 +199,7 @@ class AnalyticsViewSet(GenericViewSet):
# sheet 3 for Juniors Leaderboard and rank
elif sheet_name == 'Juniors Leaderboard':
queryset = JuniorPoints.objects.prefetch_related('junior', 'junior__auth').annotate(rank=Window(
queryset = JuniorPoints.objects.select_related('junior', 'junior__auth').annotate(rank=Window(
expression=Rank(),
order_by=[F('total_points').desc(), 'junior__created_at']
)).order_by('-total_points', 'junior__created_at')[:15]