current page update in article api

This commit is contained in:
jain
2023-08-10 15:30:46 +05:30
parent 7a9be0326a
commit 69723b362f
8 changed files with 78 additions and 14 deletions

View File

@ -4,6 +4,7 @@ from django.conf import settings
"""Third party Django app"""
from templated_email import send_templated_mail
from .models import JuniorPoints
from base.constants import NUMBER
from django.db.models import F
# junior notification
# email for sending email
@ -53,8 +54,8 @@ def update_positions_based_on_points():
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
position = NUMBER['one']
for junior_point in juniors_points:
junior_point.position = position
junior_point.save()
position += 1
position += NUMBER['one']