Skip to content

Commit

Permalink
fix content api assets endpoint when using s3 (#2750)
Browse files Browse the repository at this point in the history
it has the extension as part of the id, so first
try to fetch that and only when missing remove
the extension.
  • Loading branch information
petrjasek committed Nov 7, 2024
1 parent df5a0d9 commit 4453b61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content_api/assets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def get_media_streamed(media_id):
if not app.auth.authorized([], "assets", "GET"):
return app.auth.authenticate()
try:
media_id = media_id.split(".")[0]
media_file = app.media.get(media_id, "upload")
if not media_file:
media_id = media_id.split(".")[0]
media_file = app.media.get(media_id, "upload")
except bson.errors.InvalidId:
media_file = None
if media_file:
Expand Down

0 comments on commit 4453b61

Please sign in to comment.