From c837075bc1e74a3253e6277c32d4cbd41d0566c8 Mon Sep 17 00:00:00 2001 From: Ethan <152436775+the-sam-sepiol@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:51:57 -0500 Subject: [PATCH 1/3] Change view to sort student teams by "faculty=False" for both Teams page view and Index view --- src/core/views.py | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/core/views.py b/src/core/views.py index 8eef1ea..b63855c 100644 --- a/src/core/views.py +++ b/src/core/views.py @@ -56,19 +56,11 @@ def get_context_data(self, **kwargs): teams_set = Team.objects.all() participants_set = Profile.objects.all() - # Aggregate upper division team and participant info - upper_teams_set = teams_set.filter(division=1).filter( - faculty=False).exclude(num_members=0) - context['num_upper_teams'] = upper_teams_set.count() - context['num_upper_participants'] = participants_set.filter( - team__division=1).count() - - # Aggregate lower division team and participant info - lower_teams_set = teams_set.filter(division=2).filter( - faculty=False).exclude(num_members=0) - context['num_lower_teams'] = lower_teams_set.count() - context['num_lower_participants'] = participants_set.filter( - team__division=2).count() + # instead of sorting by a division, now we will sort by faculty=False + student_teams_set = teams_set.filter(faculty=False).exclude(num_members=0) + context['num_student_teams'] = student_teams_set.count() + context['num_student_participants'] = participants_set.filter( + team__faculty=False).count() # Aggregate faculty team and participant info faculty_teams_set = teams_set.filter(faculty=True).exclude(num_members=0) @@ -113,17 +105,11 @@ def get_context_data(self, **kwargs): teams_set = Team.objects.all() participants_set = Profile.objects.all() - # Aggregate upper division team and participant info - upper_teams_set = teams_set.filter(division=1).filter(faculty=False).exclude(num_members=0) - context['upper_teams'] = upper_teams_set.order_by('-questions_answered', 'score', 'last_submission', 'name') - context['num_upper_teams'] = upper_teams_set.count() - context['num_upper_participants'] = participants_set.filter(team__division=1).count() - - # Aggregate lower division team and participant info - lower_teams_set = teams_set.filter(division=2).filter(faculty=False).exclude(num_members=0) - context['lower_teams'] = lower_teams_set.order_by('-questions_answered', 'score', 'last_submission', 'name') - context['num_lower_teams'] = lower_teams_set.count() - context['num_lower_participants'] = participants_set.filter(team__division=2).count() + # Sort by faculty=False to get all student teams regardless of Div + student_teams_set = teams_set.filter(faculty=False).exclude(num_members=0) + context['student_teams'] = student_teams_set.order_by('-questions_answered', 'score', 'last_submission', 'name') + context['num_student_teams'] = student_teams_set.count() + context['num_student_participants'] = participants_set.filter(team__faculty=False).count() # Aggregate faculty team and participant info faculty_teams_set = teams_set.filter(faculty=True).exclude(num_members=0) From 07b85ddb3b2223b9ff2125484912b63d592b6c04 Mon Sep 17 00:00:00 2001 From: Ethan <152436775+the-sam-sepiol@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:55:13 -0500 Subject: [PATCH 2/3] Propagated changes from views to html templates for index and teams --- src/core/templates/core/index.html | 20 ++----- src/core/templates/core/teams.html | 83 ++---------------------------- 2 files changed, 10 insertions(+), 93 deletions(-) diff --git a/src/core/templates/core/index.html b/src/core/templates/core/index.html index 63f0bab..8b02009 100644 --- a/src/core/templates/core/index.html +++ b/src/core/templates/core/index.html @@ -266,25 +266,15 @@
{% if forloop.counter == 1 and contest.is_contest_complete %}
@@ -84,79 +84,6 @@ Upper Division-
-
{% if num_faculty_teams > 0 %}
-
- Lower Division- - -
-
-
From ee62872ef023f013a83881fccf28957d0bd54336 Mon Sep 17 00:00:00 2001
From: the-sam-sepiol <152436775+the-sam-sepiol@users.noreply.github.com>
Date: Mon, 9 Mar 2026 17:08:16 -0400
Subject: [PATCH 3/3] Fix participants label on Teams page
---
src/core/templates/core/teams.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/templates/core/teams.html b/src/core/templates/core/teams.html
index 6afcba4..b1059ff 100644
--- a/src/core/templates/core/teams.html
+++ b/src/core/templates/core/teams.html
@@ -20,7 +20,7 @@ Teamsnumber of student teams |