Skip to content

Commit e24fd00

Browse files
committed
Refactor top referrals query comment in home view
1 parent b5815cd commit e24fd00

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

website/views/core.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1246,9 +1246,10 @@ def home(request):
12461246
# Get top earners
12471247
top_earners = UserProfile.objects.filter(winnings__gt=0).select_related("user").order_by("-winnings")[:5]
12481248

1249-
# Get top referrals - users with the most successful signups
1249+
# Get top referrals
12501250
top_referrals = (
1251-
InviteFriend.objects.filter(point_by_referral__gt=0).annotate(signup_count=Count("recipients"), total_points=F("point_by_referral"))
1251+
InviteFriend.objects.filter(point_by_referral__gt=0)
1252+
.annotate(signup_count=Count("recipients"), total_points=F("point_by_referral"))
12521253
.select_related("sender", "sender__userprofile")
12531254
.order_by("-point_by_referral")[:5]
12541255
)

0 commit comments

Comments
 (0)