mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 00:54:54 +00:00
added notification for existing junior add, modified leaderboard method at every places
This commit is contained in:
@ -259,10 +259,14 @@ class TopJuniorListAPIView(viewsets.ModelViewSet):
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
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')
|
||||
queryset = JuniorPoints.objects.filter(
|
||||
junior__is_verified=True
|
||||
).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')
|
||||
return queryset
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user