Skip to content

Commit

Permalink
Log warning for missing license_url in meta_data
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed May 29, 2024
1 parent 70d57a9 commit 4a3a800
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/api/models/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def license_url(self) -> str | None:

if self.meta_data and (url := self.meta_data.get("license_url")):
return url

logger.warning(
f"The {self.__class__.__name__.lower()} with identifier={self.identifier} "
f"has no `license_url` in `meta_data`."
)
try:
return License(self.license.lower(), self.license_version).url
except ValueError:
Expand Down

0 comments on commit 4a3a800

Please sign in to comment.