Fix Excel download of ordering batch, per python3
This commit is contained in:
parent
5a96672d79
commit
318e8645b2
2 changed files with 7 additions and 10 deletions
|
@ -36,8 +36,6 @@ from rattail.db import model, api
|
|||
from rattail.core import Object
|
||||
from rattail.time import localtime
|
||||
|
||||
from pyramid.response import FileResponse
|
||||
|
||||
from tailbone.views.purchasing import PurchasingBatchView
|
||||
|
||||
|
||||
|
@ -354,10 +352,7 @@ class OrderingBatchView(PurchasingBatchView):
|
|||
path = batch.filepath(self.rattail_config, filename)
|
||||
workbook.save(path)
|
||||
|
||||
response = FileResponse(path, request=self.request)
|
||||
response.content_length = os.path.getsize(path)
|
||||
response.content_disposition = b'attachment; filename="{}"'.format(filename)
|
||||
return response
|
||||
return self.file_response(path)
|
||||
|
||||
@classmethod
|
||||
def _ordering_defaults(cls, config):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue