Skip to content

Commit

Permalink
Merge pull request #927 from thunderstore-io/cyberstorm-nonnullable-p…
Browse files Browse the repository at this point in the history
…ackage-icon

Cyberstorm API: packages are always guaranteed to have an icon image
  • Loading branch information
anttimaki authored Dec 5, 2023
2 parents f43b743 + d1b7386 commit 7367421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/thunderstore/api/cyberstorm/serializers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CyberstormPackagePreviewSerializer(serializers.Serializer):
max_length=PackageVersion._meta.get_field("description").max_length,
)
download_count = serializers.IntegerField(min_value=0)
icon_url = serializers.CharField(allow_null=True)
icon_url = serializers.CharField()
is_deprecated = serializers.BooleanField()
is_nsfw = serializers.BooleanField()
is_pinned = serializers.BooleanField()
Expand Down
2 changes: 1 addition & 1 deletion django/thunderstore/api/cyberstorm/views/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _get_packages_dicts(self, package_page: Page):
"community_identifier": community_id,
"description": p.latest.description,
"download_count": p.download_count,
"icon_url": p.latest.icon.url if bool(p.latest.icon) else None,
"icon_url": p.latest.icon.url,
"is_deprecated": p.is_deprecated,
"is_nsfw": listing.has_nsfw_content,
"is_pinned": p.is_pinned,
Expand Down

0 comments on commit 7367421

Please sign in to comment.