diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 3169c613ca..f4b5f4a5eb 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -180,7 +180,7 @@ class PartList(generics.ListCreateAPIView): # Pass a list of "starred" parts fo the current user to the serializer # We do this to reduce the number of database queries required! - if self.starred_parts is None: + if self.starred_parts is None and self.request is not None: self.starred_parts = [star.part for star in self.request.user.starred_parts.all()] kwargs['starred_parts'] = self.starred_parts