Back to old query

This commit is contained in:
cuom1999 2023-01-23 21:00:11 -06:00
parent 2270730407
commit 15913e51f3
2 changed files with 3 additions and 9 deletions

View file

@ -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):

View file

@ -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,