junior points

This commit is contained in:
jain
2023-08-10 11:56:19 +05:30
parent b6b70af13f
commit b30643299f
3 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,7 @@ def junior_approval_mail(guardian, full_name):
def update_positions_based_on_points():
"""Update position of the junior"""
# First, retrieve all the JuniorPoints instances ordered by total_points in descending order.
juniors_points = JuniorPoints.objects.order_by('-total_points', 'updated_at')
juniors_points = JuniorPoints.objects.order_by('-total_points', 'created_at')
# Now, iterate through the queryset and update the position field based on the order.
position = 1