Merge pull request #772 from taigaio/remove-storage-path-call
Remove storage.path usage for allow other Storage Backendsremotes/origin/issue/4795/notification_even_they_are_disabled
commit
b0df33ed2e
|
@ -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 = {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue