diff --git a/taiga/export_import/api.py b/taiga/export_import/api.py index eaff499d..da2af132 100644 --- a/taiga/export_import/api.py +++ b/taiga/export_import/api.py @@ -76,13 +76,11 @@ class ProjectExporterViewSet(mixins.ImportThrottlingPolicyMixin, GenericViewSet) if dump_format == "gzip": path = "exports/{}/{}-{}.json.gz".format(project.pk, project.slug, uuid.uuid4().hex) - storage_path = default_storage.path(path) - with default_storage.open(storage_path, mode="wb") as outfile: + with default_storage.open(path, mode="wb") as outfile: services.render_project(project, gzip.GzipFile(fileobj=outfile)) else: path = "exports/{}/{}-{}.json".format(project.pk, project.slug, uuid.uuid4().hex) - storage_path = default_storage.path(path) - with default_storage.open(storage_path, mode="wb") as outfile: + with default_storage.open(path, mode="wb") as outfile: services.render_project(project, outfile) response_data = { diff --git a/taiga/export_import/tasks.py b/taiga/export_import/tasks.py index aa75c257..5acb08a2 100644 --- a/taiga/export_import/tasks.py +++ b/taiga/export_import/tasks.py @@ -46,13 +46,11 @@ def dump_project(self, user, project, dump_format): try: if dump_format == "gzip": path = "exports/{}/{}-{}.json.gz".format(project.pk, project.slug, self.request.id) - storage_path = default_storage.path(path) - with default_storage.open(storage_path, mode="wb") as outfile: + with default_storage.open(path, mode="wb") as outfile: services.render_project(project, gzip.GzipFile(fileobj=outfile)) else: path = "exports/{}/{}-{}.json".format(project.pk, project.slug, self.request.id) - storage_path = default_storage.path(path) - with default_storage.open(storage_path, mode="wb") as outfile: + with default_storage.open(path, mode="wb") as outfile: services.render_project(project, outfile) url = default_storage.url(path)