Skip to content

Commit

Permalink
Import from werkzeug locally so that the import is only used when ini…
Browse files Browse the repository at this point in the history
…tializing localCKAN
  • Loading branch information
Zharktas committed Mar 11, 2024
1 parent 5f24e96 commit 2f34fe4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckanapi/localckan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from werkzeug.datastructures import FileStorage
from tempfile import TemporaryFile

from ckanapi.errors import CKANAPIError
Expand Down Expand Up @@ -64,6 +63,9 @@ def call_action(self, action, data_dict=None, context=None, apikey=None,
except (AttributeError, IOError):
f = _write_temp_file(f)
to_close.append(f)

from werkzeug.datastructures import FileStorage

file_storage = FileStorage()
file_storage.stream = f
file_storage.filename = filename
Expand Down

0 comments on commit 2f34fe4

Please sign in to comment.