mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 02:16:16 +00:00
current page update in article api
This commit is contained in:
@ -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']
|
||||
|
Reference in New Issue
Block a user