From 7e8906ae7e2fd5f63aac0b7c93785bfe5f62c19c Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Mon, 13 Feb 2023 21:01:37 -0600 Subject: [PATCH] Clean up unused url --- dmoj/urls.py | 7 ------ judge/views/ranked_submission.py | 39 +------------------------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/dmoj/urls.py b/dmoj/urls.py index 1407dd0..6cb55b5 100644 --- a/dmoj/urls.py +++ b/dmoj/urls.py @@ -542,13 +542,6 @@ urlpatterns = [ url(r"^/join$", contests.ContestJoin.as_view(), name="contest_join"), url(r"^/leave$", contests.ContestLeave.as_view(), name="contest_leave"), url(r"^/stats$", contests.ContestStats.as_view(), name="contest_stats"), - url( - r"^/rank/(?P\w+)/", - paged_list_view( - ranked_submission.ContestRankedSubmission, - "contest_ranked_submissions", - ), - ), url( r"^/submissions/(?P\w+)/(?P\w+)", paged_list_view( diff --git a/judge/views/ranked_submission.py b/judge/views/ranked_submission.py index a0180b3..a08bb98 100644 --- a/judge/views/ranked_submission.py +++ b/judge/views/ranked_submission.py @@ -7,7 +7,7 @@ from judge.utils.problems import get_result_data from judge.utils.raw_sql import join_sql_subquery from judge.views.submission import ForceContestMixin, ProblemSubmissions -__all__ = ["RankedSubmissions", "ContestRankedSubmission"] +__all__ = ["RankedSubmissions"] class RankedSubmissions(ProblemSubmissions): @@ -79,40 +79,3 @@ class RankedSubmissions(ProblemSubmissions): return get_result_data( super(RankedSubmissions, self)._get_queryset().order_by() ) - - -class ContestRankedSubmission(ForceContestMixin, RankedSubmissions): - def get_title(self): - if self.problem.is_accessible_by(self.request.user): - return _("Best solutions for %(problem)s in %(contest)s") % { - "problem": self.problem_name, - "contest": self.contest.name, - } - return _("Best solutions for problem %(number)s in %(contest)s") % { - "number": self.get_problem_number(self.problem), - "contest": self.contest.name, - } - - def get_content_title(self): - if self.problem.is_accessible_by(self.request.user): - return format_html( - _('Best solutions for {0} in {2}'), - self.problem_name, - reverse("problem_detail", args=[self.problem.code]), - self.contest.name, - reverse("contest_view", args=[self.contest.key]), - ) - return format_html( - _('Best solutions for problem {0} in {1}'), - self.get_problem_number(self.problem), - self.contest.name, - reverse("contest_view", args=[self.contest.key]), - ) - - def _get_result_data(self): - return get_result_data( - Submission.objects.filter( - problem_id=self.problem.id, - contest__participation__contest_id=self.contest.id, - ) - )