Fix bug when downloading batch file

This commit is contained in:
Lance Edgar 2016-11-21 14:39:04 -06:00
parent 8399eb8f91
commit 674a315104

View file

@ -946,7 +946,7 @@ class FileBatchMasterView(BatchMasterView):
batch = self.get_instance() batch = self.get_instance()
if not batch: if not batch:
raise httpexceptions.HTTPNotFound() raise httpexceptions.HTTPNotFound()
path = self.handler.data_path(batch) path = batch.filepath(self.rattail_config)
response = FileResponse(path, request=self.request) response = FileResponse(path, request=self.request)
response.headers[b'Content-Length'] = str(os.path.getsize(path)) response.headers[b'Content-Length'] = str(os.path.getsize(path))
filename = os.path.basename(batch.filename).encode('ascii', 'replace') filename = os.path.basename(batch.filename).encode('ascii', 'replace')