Clean up unused url

This commit is contained in:
cuom1999 2023-02-13 21:01:37 -06:00
parent 7b2c4126f9
commit 7e8906ae7e
2 changed files with 1 additions and 45 deletions

View file

@ -542,13 +542,6 @@ urlpatterns = [
url(r"^/join$", contests.ContestJoin.as_view(), name="contest_join"), url(r"^/join$", contests.ContestJoin.as_view(), name="contest_join"),
url(r"^/leave$", contests.ContestLeave.as_view(), name="contest_leave"), url(r"^/leave$", contests.ContestLeave.as_view(), name="contest_leave"),
url(r"^/stats$", contests.ContestStats.as_view(), name="contest_stats"), url(r"^/stats$", contests.ContestStats.as_view(), name="contest_stats"),
url(
r"^/rank/(?P<problem>\w+)/",
paged_list_view(
ranked_submission.ContestRankedSubmission,
"contest_ranked_submissions",
),
),
url( url(
r"^/submissions/(?P<user>\w+)/(?P<problem>\w+)", r"^/submissions/(?P<user>\w+)/(?P<problem>\w+)",
paged_list_view( paged_list_view(

View file

@ -7,7 +7,7 @@ from judge.utils.problems import get_result_data
from judge.utils.raw_sql import join_sql_subquery from judge.utils.raw_sql import join_sql_subquery
from judge.views.submission import ForceContestMixin, ProblemSubmissions from judge.views.submission import ForceContestMixin, ProblemSubmissions
__all__ = ["RankedSubmissions", "ContestRankedSubmission"] __all__ = ["RankedSubmissions"]
class RankedSubmissions(ProblemSubmissions): class RankedSubmissions(ProblemSubmissions):
@ -79,40 +79,3 @@ class RankedSubmissions(ProblemSubmissions):
return get_result_data( return get_result_data(
super(RankedSubmissions, self)._get_queryset().order_by() 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 <a href="{1}">{0}</a> in <a href="{3}">{2}</a>'),
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 <a href="{2}">{1}</a>'),
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,
)
)