Don't allow docs comments on unsupported versions

This commit is contained in:
Magnus Hagander
2018-05-03 19:44:11 +02:00
parent 1a0c151b9e
commit e8eb10d9a7
2 changed files with 7 additions and 0 deletions

View File

@ -128,6 +128,11 @@ def manualarchive(request):
@login_required
def commentform(request, itemid, version, filename):
v = get_object_or_404(Version, tree=version)
if not v.supported:
# No docs comments on unsupported versions
return HttpResponseRedirect("/docs/{0}/static/{1}".format(version, filename))
if request.method == 'POST':
form = DocCommentForm(request.POST)
if form.is_valid():