fix: Ensure platform_id is a digit before querying Platform

This commit is contained in:
wangruidong
2025-05-29 16:09:22 +08:00
committed by 老广
parent e4be9621bb
commit 53a84850dc

View File

@@ -46,7 +46,7 @@ class DatabaseSerializer(AssetSerializer):
elif self.context.get('request'):
platform_id = self.context['request'].query_params.get('platform')
if not platform and platform_id:
if not platform and platform_id and platform_id.isdigit():
platform = Platform.objects.filter(id=platform_id).first()
return platform