Skip to content

Commit

Permalink
More remote print debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Nov 23, 2024
1 parent 8c87d91 commit ff6f3dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions flask_admin/contrib/fileadmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ def edit(self):
helpers.flash_errors(form, message="Failed to edit file. %(error)s")

try:
print("reading file", full_path)
content = self.storage.read_file(full_path)
except OSError:
flash(gettext("Error reading %(name)s.", name=path), "error")
Expand Down
5 changes: 4 additions & 1 deletion flask_admin/contrib/fileadmin/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ def read_file(self, path):
path = self._ensure_blob_path(path)
if path is None:
raise ValueError("No path provided")
blob = self._container_client.get_blob_client(path).download_blob()
try:
blob = self._container_client.get_blob_client(path).download_blob()
except Exception as e:
print(f"Error reading file: {path}", e)
return blob.readall()

def write_file(self, path, content):
Expand Down

0 comments on commit ff6f3dc

Please sign in to comment.