Skip to content

Commit

Permalink
Merge pull request #34 from lirmm/StrangeStuff-patch-4
Browse files Browse the repository at this point in the history
Fix files retrieval and services exportation
  • Loading branch information
marcoooo committed Sep 12, 2019
2 parents caee13c + d2278e2 commit 59fac0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions waves/wcore/views/files.py
Expand Up @@ -17,7 +17,7 @@ class DownloadFileView(generic.DetailView):
context_object_name = 'file'
slug_field = 'slug'
http_method_names = ['get', ]
_force_download = True
_force_download = False
file_type = None
object = None

Expand All @@ -30,8 +30,8 @@ def get_object(self, queryset=None):

def get(self, request, *args, **kwargs):
self.object = self.get_object()
assert isinstance(self.object, ExportAbleMixin), 'Model object must be Export-able'
self.object.serialize()
if isinstance(self.object, ExportAbleMixin):
self.object.serialize()
self.file_type = magic.from_file(self.file_path)
export = 'export' in self.request.GET or self._force_download is True
if 'text' not in self.file_type and not export:
Expand Down

0 comments on commit 59fac0c

Please sign in to comment.