From f5c86bc45788061aebdda3e38acae98bd5d84b36 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 20 Apr 2020 01:23:05 +1000 Subject: [PATCH] "Fix" for unit tests - Not working in travis for some reason? - But they are working locally... --- InvenTree/part/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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