Remove: old serve_submission_file view func

This commit is contained in:
Aroy-Art 2024-01-01 11:57:44 +01:00
parent 4c43e6a5c5
commit fcee63998e
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -32,30 +32,6 @@ def compute_file_hash(file):
return None
@login_required(login_url="/login/")
def serve_submission_file(request, file_hash):
'''
View function to serve submission files for download or inline viewing
'''
download = request.GET.get('d')
try:
submission_file = get_object_or_404(Submission_File, file_hash=file_hash)
file = submission_file.file.file
file_name = submission_file.file_name
response = FileResponse(file)
if download == "1":
response['Content-Disposition'] = f'attachment; filename="{file_name}"'
else:
response['Content-Disposition'] = f'inline; filename="{file_name}"'
return response
except:
return HttpResponse("File not found", status=404)
@login_required(login_url="/login/")
def serve_content_file(request, folder, file_hash):
'''