added notification when admin adds a new article

This commit is contained in:
abutalib-kiwi
2023-08-25 16:59:10 +05:30
parent b82902081f
commit 21b92f8c74
8 changed files with 32 additions and 13 deletions

View File

@ -70,7 +70,7 @@ def get_junior_leaderboard_rank(junior_obj):
:param junior_obj:
:return: junior's position/rank
"""
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')