diff --git a/api/api/models/media.py b/api/api/models/media.py index 22b4494c7af..d95cb1846d2 100644 --- a/api/api/models/media.py +++ b/api/api/models/media.py @@ -106,8 +106,11 @@ def license_url(self) -> str: def attribution(self) -> str: """Legally valid attribution for the media item in plain-text English.""" + lic = self.license.lower() + if lic == "publicdomain": + lic = "pdm" return get_attribution_text( - self.license.lower(), + lic, self.title, self.creator, self.license_version, diff --git a/api/api/utils/watermark.py b/api/api/utils/watermark.py index 3f82ff8f66d..27c99706a2f 100644 --- a/api/api/utils/watermark.py +++ b/api/api/utils/watermark.py @@ -190,8 +190,11 @@ def _print_attribution_on_image(img: Image.Image, image_info): font = ImageFont.truetype(_get_font_path(), size=font_size) + lic = image_info["license"] + if lic == "publicdomain": + lic = "pdm" text = get_attribution_text( - image_info["license"], + lic, image_info["title"], image_info["creator"], image_info["license_version"],