Back to old query
This commit is contained in:
parent
2270730407
commit
15913e51f3
2 changed files with 3 additions and 9 deletions
|
@ -69,7 +69,7 @@ from judge.utils.views import (
|
||||||
DiggPaginatorMixin,
|
DiggPaginatorMixin,
|
||||||
)
|
)
|
||||||
from judge.utils.problems import user_attempted_ids, user_completed_ids
|
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.contests import ContestList
|
||||||
from judge.views.submission import AllSubmissions, SubmissionsListBase
|
from judge.views.submission import AllSubmissions, SubmissionsListBase
|
||||||
from judge.views.pagevote import PageVoteListView
|
from judge.views.pagevote import PageVoteListView
|
||||||
|
@ -473,11 +473,10 @@ class OrganizationSubmissions(
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _get_queryset(self):
|
def _get_queryset(self):
|
||||||
problems = get_problems_in_organization(self.request, self.organization)
|
|
||||||
return (
|
return (
|
||||||
super()
|
super()
|
||||||
._get_entire_queryset()
|
._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):
|
def get_context_data(self, **kwargs):
|
||||||
|
|
|
@ -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 DiggPaginatorMixin
|
||||||
from judge.utils.views import TitleMixin
|
from judge.utils.views import TitleMixin
|
||||||
from judge.utils.timedelta import nice_repr
|
from judge.utils.timedelta import nice_repr
|
||||||
from judge.views.problem import get_problems_in_organization
|
|
||||||
|
|
||||||
|
|
||||||
MAX_NUMBER_OF_QUERY_SUBMISSIONS = 50000
|
MAX_NUMBER_OF_QUERY_SUBMISSIONS = 50000
|
||||||
|
@ -416,12 +415,8 @@ class SubmissionsListBase(DiggPaginatorMixin, TitleMixin, ListView):
|
||||||
queryset = self._get_entire_queryset()
|
queryset = self._get_entire_queryset()
|
||||||
if not self.in_contest:
|
if not self.in_contest:
|
||||||
if self.request.organization:
|
if self.request.organization:
|
||||||
problems = get_problems_in_organization(
|
|
||||||
self.request, self.request.organization
|
|
||||||
)
|
|
||||||
queryset = queryset.filter(
|
queryset = queryset.filter(
|
||||||
user__in=self.request.organization.members.all(),
|
contest_object__organizations=self.request.organization
|
||||||
problem__in=problems,
|
|
||||||
)
|
)
|
||||||
join_sql_subquery(
|
join_sql_subquery(
|
||||||
queryset,
|
queryset,
|
||||||
|
|
Loading…
Reference in a new issue