Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
fix data export in django 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Yunenko committed Apr 19, 2020
1 parent 5a7897a commit b3766b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Changelog
=========


5.0.4 (2020-05-19)
==================

* Fix admin panel export in Django 2


5.0.1 (2020-01-06)
==================

Expand Down
2 changes: 1 addition & 1 deletion aldryn_forms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '5.0.3'
__version__ = '5.0.4'
11 changes: 1 addition & 10 deletions aldryn_forms/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ def done(self, form_list, **kwargs):
filename = step_1_form.get_filename(extension=self.file_type)

content_type = self.get_content_type()

response_kwargs = {}

if int(get_version().split('.')[1]) > 6:
response_kwargs['content_type'] = content_type
else:
# Django <= 1.6 compatibility
response_kwargs['mimetype'] = content_type

response = HttpResponse(dataset.xls, **response_kwargs)
response = HttpResponse(dataset.xls, content_type=content_type)
response['Content-Disposition'] = 'attachment; filename=%s' % filename
return response

0 comments on commit b3766b3

Please sign in to comment.