Merge pull request #11926 from jumpserver/pr@dev@database_list

fix: 资产数据库 不分页时list接口错误
This commit is contained in:
老广
2023-10-20 03:51:07 -05:00
committed by GitHub

View File

@@ -1,3 +1,4 @@
from django.db.models import QuerySet
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
@@ -34,7 +35,7 @@ class DatabaseSerializer(AssetSerializer):
if not platform_id and self.instance:
platform = self.instance.platform
elif getattr(self, 'instance', None):
if isinstance(self.instance, list):
if isinstance(self.instance, (list, QuerySet)):
return
platform = self.instance.platform
elif self.context.get('request'):