From c449f26ad7867ec414d5325efad8ca6c7334323a Mon Sep 17 00:00:00 2001 From: Starthur Date: Mon, 1 Aug 2022 22:15:42 +0200 Subject: [PATCH] Check FK to print value in scoreboard --- .../templates/scoreboard/scoreboard.html | 14 +++++++------- src/scoreboard/views.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/scoreboard/templates/scoreboard/scoreboard.html b/src/scoreboard/templates/scoreboard/scoreboard.html index af7442b..798b24b 100644 --- a/src/scoreboard/templates/scoreboard/scoreboard.html +++ b/src/scoreboard/templates/scoreboard/scoreboard.html @@ -28,9 +28,9 @@ {% endif %} - {% if s.user.userprofileinfo.intra42_campus %} - - {{ s.user.userprofileinfo.intra42_campus }} + {% if s.user.userprofileinfo.campus %} + + {{ s.user.userprofileinfo.campus }} {% endif %} @@ -39,25 +39,25 @@ {% endfor %} - + - + diff --git a/src/scoreboard/views.py b/src/scoreboard/views.py index 1aeb356..c5fb031 100644 --- a/src/scoreboard/views.py +++ b/src/scoreboard/views.py @@ -10,7 +10,7 @@ def scoreboard(request): return render(request, 'scoreboard/scoreboard.html', {'scores':scores_p}) def campus(request, campus): - scores = UserProfileInfo.objects.filter(score__gt=0, intra42_campus__exact=campus).select_related().order_by('-score', 'last_submission_date', 'user__username') + scores = UserProfileInfo.objects.filter(score__gt=0, campus__name__exact=campus).select_related().order_by('-score', 'last_submission_date', 'user__username') paginator = Paginator(scores, 20) page = request.GET.get('page') scores_p = paginator.get_page(page)