From 15913e51f3a5dc98c73731ddb6261958d8bf0d86 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 23 Jan 2023 21:00:11 -0600 Subject: [PATCH] Back to old query --- judge/views/organization.py | 5 ++--- judge/views/submission.py | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/judge/views/organization.py b/judge/views/organization.py index 051fe7a..d36e7ab 100644 --- a/judge/views/organization.py +++ b/judge/views/organization.py @@ -69,7 +69,7 @@ from judge.utils.views import ( DiggPaginatorMixin, ) from judge.utils.problems import user_attempted_ids, user_completed_ids -from judge.views.problem import ProblemList, get_problems_in_organization +from judge.views.problem import ProblemList from judge.views.contests import ContestList from judge.views.submission import AllSubmissions, SubmissionsListBase from judge.views.pagevote import PageVoteListView @@ -473,11 +473,10 @@ class OrganizationSubmissions( return None def _get_queryset(self): - problems = get_problems_in_organization(self.request, self.organization) return ( super() ._get_entire_queryset() - .filter(user__in=self.organization.members.all(), problem__in=problems) + .filter(contest_object__organizations=self.organization) ) def get_context_data(self, **kwargs): diff --git a/judge/views/submission.py b/judge/views/submission.py index e2a091b..484d23e 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -49,7 +49,6 @@ from judge.utils.raw_sql import join_sql_subquery, use_straight_join from judge.utils.views import DiggPaginatorMixin from judge.utils.views import TitleMixin from judge.utils.timedelta import nice_repr -from judge.views.problem import get_problems_in_organization MAX_NUMBER_OF_QUERY_SUBMISSIONS = 50000 @@ -416,12 +415,8 @@ class SubmissionsListBase(DiggPaginatorMixin, TitleMixin, ListView): queryset = self._get_entire_queryset() if not self.in_contest: if self.request.organization: - problems = get_problems_in_organization( - self.request, self.request.organization - ) queryset = queryset.filter( - user__in=self.request.organization.members.all(), - problem__in=problems, + contest_object__organizations=self.request.organization ) join_sql_subquery( queryset,