Skip to content

Commit

Permalink
fixed webdav json parsing (entry can be str or dict)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Oct 8, 2024
1 parent 8c8b0dc commit 4529a26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/api/routes/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ def __init__(self, data: list[dict[str, str | list[str]]]):
self.data = data
self.files_indexes: dict[str, int] = {}
for index, entry in enumerate(self.data):
for filename in entry.get("files", []):
for fileentry in entry.get("files", []):
if isinstance(fileentry, str):
filename = fileentry
else:
filename = fileentry["filename"]
self.files_indexes[filename] = index

def __getitem__(self, key: str):
Expand Down

0 comments on commit 4529a26

Please sign in to comment.