fix(itimm): correct truthy check for service device ViewSet property when evaluating queryset

ref: #512 #518
This commit is contained in:
2025-02-06 20:45:56 +09:30
parent cf35677464
commit 21a85555a7

View File

@ -34,11 +34,13 @@ class ViewSet(ReadOnlyModelViewSet):
def get_queryset(self):
queryset = super().get_queryset()
if self.queryset is not None:
queryset = queryset.filter(device_id=self.kwargs['device_id'])
return self.queryset
self.queryset = queryset
self.queryset = super().get_queryset()
self.queryset = self.queryset.filter(device_id=self.kwargs['device_id'])
return self.queryset