Fix unrestricted evaluations of RestrictedQuerySet

This commit is contained in:
Jeremy Stretch
2020-06-29 13:30:41 -04:00
parent 2c47e3341c
commit 3445147773
3 changed files with 66 additions and 57 deletions

View File

@@ -226,7 +226,7 @@ class ManufacturerViewSet(ModelViewSet):
#
class DeviceTypeViewSet(CustomFieldModelViewSet):
queryset = DeviceType.objects.prefetch_related('manufacturer').prefetch_related('tags').annotate(
queryset = DeviceType.objects.prefetch_related('manufacturer', 'tags').annotate(
device_count=Count('instances')
)
serializer_class = serializers.DeviceTypeSerializer