perf: 修复 role user serializer 问题

This commit is contained in:
ibuler
2023-02-22 22:20:11 +08:00
parent 58341a9e85
commit c4982dd3b5
2 changed files with 10 additions and 7 deletions

View File

@@ -72,7 +72,7 @@ class RoleViewSet(JMSModelViewSet):
return queryset
def get_serializer(self, *args, **kwargs):
if len(args) == 1:
if len(args) == 1 and kwargs.get('many', False):
queryset = self.set_users_amount(args[0])
args = (queryset,)
return super().get_serializer(*args, **kwargs)