Skip to content

Commit

Permalink
Fix case-insensitive Cyberstorm APIs
Browse files Browse the repository at this point in the history
Fix Cyberstorm APIs which would fail if there were multiple packages
with the same name in a different case.
  • Loading branch information
x753 committed Sep 23, 2024
1 parent 23f4db9 commit aba4310
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion django/thunderstore/api/cyberstorm/views/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_package_version(
package = get_object_or_404(
Package.objects.active(),
namespace__name=namespace_id,
name__iexact=package_name,
name=package_name,
)

if version_number:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_custom_package_listing(
qs,
community__identifier=community_id,
package__namespace__name=namespace_id,
package__name__iexact=package_name,
package__name=package_name,
)

dependencies = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def get_queryset(self) -> QuerySet[Package]:
listings,
community__identifier=community_id,
package__namespace__name=namespace_id,
package__name__iexact=package_name,
package__name=package_name,
)

queryset = get_package_dependants(listing.package.pk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_queryset(self):
package = get_object_or_404(
Package.objects.active(),
namespace__name=self.kwargs["namespace_id"],
name__iexact=self.kwargs["package_name"],
name=self.kwargs["package_name"],
)

return package.versions.active()

0 comments on commit aba4310

Please sign in to comment.