Commit ef1a3cd1 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

replace the TosDetail page with a 302 redirect to the PDF

parent 5491ff41
......@@ -1491,12 +1491,11 @@ def auth(request):
return HttpResponse(status=403)
class TosDetail(View):
class TosDetail(DetailView):
template_name = 'tos_detail.html'
context_object_name = 'tos'
def get(self, request):
tos = Tos.get_latest()
if tos is None:
raise Http404
return redirect(tos.url)
def get_object(self):
"""Returns the object according to its docker name or a 404 error"""
last_tos = Tos.objects.order_by('-version').first()
return last_tos
{% extends "base.html" %}
{% load converters %}
{% block title %}Terms of Service{% endblock %}
{% block breadcrumb %}
<li class="breadcrumb-item active" aria-current="page">Terms of Service</li>
{% endblock %}
{% block content %}
<div class="container">
<div class="allgo-page">
{% if tos.url %}
<p>You can read the Terms of Service as a <a href="{{ tos.url }}">PDF file</a>.</p>
{% endif %}
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment