Revert prev commit
This commit is contained in:
parent
28923f755b
commit
bdae79eeda
1 changed files with 5 additions and 7 deletions
|
@ -450,11 +450,9 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View):
|
||||||
if not problem.pdf_description:
|
if not problem.pdf_description:
|
||||||
raise Http404()
|
raise Http404()
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
|
# if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
|
||||||
response["X-Accel-Redirect"] = os.path.join(
|
# response["X-Accel-Redirect"] = problem.pdf_description.path
|
||||||
settings.DMOJ_PROBLEM_DATA_ROOT, problem.pdf_description.path
|
# else:
|
||||||
)
|
|
||||||
else:
|
|
||||||
with open(problem.pdf_description.path, "rb") as f:
|
with open(problem.pdf_description.path, "rb") as f:
|
||||||
response.content = f.read()
|
response.content = f.read()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue