Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove raw problem view #1801

Merged
merged 1 commit into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dmoj/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def paged_list_view(view, name):
url(r'^problem/(?P<problem>[^/]+)', include([
url(r'^$', problem.ProblemDetail.as_view(), name='problem_detail'),
url(r'^/editorial$', problem.ProblemSolution.as_view(), name='problem_editorial'),
url(r'^/raw$', problem.ProblemRaw.as_view(), name='problem_raw'),
url(r'^/pdf$', problem.ProblemPdfView.as_view(), name='problem_pdf'),
url(r'^/pdf/(?P<language>[a-z-]+)$', problem.ProblemPdfView.as_view(), name='problem_pdf'),
url(r'^/clone', problem.ProblemClone.as_view(), name='problem_clone'),
Expand Down
24 changes: 0 additions & 24 deletions judge/views/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from django.utils.safestring import mark_safe
from django.utils.translation import gettext as _, gettext_lazy
from django.views.generic import ListView, View
from django.views.generic.base import TemplateResponseMixin
from django.views.generic.detail import SingleObjectMixin
from reversion import revisions

Expand Down Expand Up @@ -138,29 +137,6 @@ def no_such_problem(self):
_('Could not find an editorial with the code "%s".') % code, status=404)


class ProblemRaw(ProblemMixin, TitleMixin, TemplateResponseMixin, SingleObjectMixin, View):
context_object_name = 'problem'
template_name = 'problem/raw.html'

def get_title(self):
return self.object.name

def get_context_data(self, **kwargs):
context = super(ProblemRaw, self).get_context_data(**kwargs)
context['problem_name'] = self.object.name
context['url'] = self.request.build_absolute_uri()
context['description'] = self.object.description
context['math_engine'] = self.request.profile.math_engine
return context

def get(self, request, *args, **kwargs):
self.object = self.get_object()
with translation.override(settings.LANGUAGE_CODE):
return self.render_to_response(self.get_context_data(
object=self.object,
))


class ProblemDetail(ProblemMixin, SolvedProblemMixin, CommentedDetailView):
context_object_name = 'problem'
template_name = 'problem/problem.html'
Expand Down
1 change: 0 additions & 1 deletion robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Disallow: /problem/*/data
Disallow: /problem/*/manage/submission
Disallow: /problem/*/pdf
Disallow: /problem/*/rank
Disallow: /problem/*/raw
Disallow: /problem/*/resubmit
Disallow: /problems/random/$
Disallow: /problem/*/submissions
Expand Down