@@ -19,13 +19,13 @@ def candidate_page(request, slug):
def download_page(request, slug, download_type):
candidate = get_object_or_404(Candidate, slug=slug)
form = DownloadForm()
if request.method == 'POST':
form = DownloadForm(request.POST)
url = candidate.source_url if download_type == 'source' else candidate.binary_url
if form.is_valid():
if not candidate.show_download_disclaimer or form.is_valid():
return redirect(url)
return render(
request,
'usethesource/download.html',
{'form': form, 'candidate': candidate, 'download_type': download_type},
)