more coverage
This commit is contained in:
@@ -28,7 +28,11 @@ def download_fit(request,filename=''):
|
||||
raise PermissionDenied("You are not allowed to download this file")
|
||||
|
||||
fitfile = ps.fitfile
|
||||
response = HttpResponse(fitfile)
|
||||
try:
|
||||
response = HttpResponse(fitfile)
|
||||
except FileNotFoundError:
|
||||
raise Http404("File not found")
|
||||
|
||||
response['Content-Disposition'] = 'attachment; filename="%s"' % filename
|
||||
response['Content-Type'] = 'application/octet-stream'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user