Skip to content

Commit

Permalink
Merge branch 'hotfix/api-media-license'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayer committed Aug 1, 2022
2 parents 5a17c27 + 8188f7d commit 323ba95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,9 @@ def get_media_for_entry_public(entry):
except KeyError:
pass
if m.get('license'):
m['license'] = m.get('license', {}).get('label', {}).get(lang)
label = m.get('license', {}).get('label', {})
# fallback for CC licenses, which only have an English label
m['license'] = label.get(lang) or label.get('en')
return media


Expand Down

0 comments on commit 323ba95

Please sign in to comment.