Skip to content

Commit

Permalink
Added Correct query for all player ratings to fix legacy.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhiiva committed Apr 21, 2021
1 parent 406ae6a commit 625cff3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions agagd/agagd_core/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,22 +322,20 @@ def country_detail(request, country_name):

def all_player_ratings(request):
all_player_ratings_query = (
Member.objects.filter(
Q(chapter_id=F("chapters__member_id")) | Q(chapters__member_id__isnull=True)
)
.filter(Q(member_id=F("players__pin_player")))
Member.objects.select_related("chapter_id")
.filter(status="accepted")
.exclude(players__rating__isnull=True)
.exclude(type="chapter")
.exclude(type="e-journal")
.exclude(type="library")
.exclude(type="institution")
.filter(players__rating__isnull=False)
.exclude(type__iexact="e-journal")
.exclude(type__iexact="chapter")
.exclude(type__iexact="library")
.exclude(type__iexact="institution")
.values(
"full_name",
"chapter_id",
"member_id",
"chapter_id__name",
"full_name",
"type",
"players__rating",
"chapter_id",
"state",
"players__sigma",
)
Expand Down

0 comments on commit 625cff3

Please sign in to comment.