Skip to content

Commit

Permalink
fix: encoded url on get_content (#51) (#52)
Browse files Browse the repository at this point in the history
* fix: encoded url on get_content (#51)

* ci: add manual moto install in CI

* chore: black

---------

Co-authored-by: Devarsh Bhatt <[email protected]>
Co-authored-by: Tyler Matteson <[email protected]>
  • Loading branch information
3 people authored May 6, 2024
1 parent bf3133c commit 0b0e8cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/frappe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
bench new-site --db-root-password root --admin-password admin test_site
bench --site test_site install-app cloud_storage
bench build
bench pip install moto[s3]
env:
CI: 'Yes'

Expand Down
3 changes: 2 additions & 1 deletion cloud_storage/cloud_storage/overrides/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from magic import from_buffer
from PIL import UnidentifiedImageError
from werkzeug.datastructures import FileStorage
from urllib.parse import quote

FILE_URL = "/api/method/retrieve?key={path}"
URL_PREFIXES = ("http://", "https://", "/api/method/retrieve")
Expand Down Expand Up @@ -181,7 +182,7 @@ def get_content(self) -> bytes:

if self.file_url:
self.validate_file_url()
file_path = self.get_full_path()
file_path = quote(self.get_full_path())

if self.is_remote_file:
client = get_cloud_storage_client()
Expand Down

0 comments on commit 0b0e8cb

Please sign in to comment.