mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
"Fix" for unit tests
- Not working in travis for some reason? - But they are working locally...
This commit is contained in:
parent
57fa69f6e6
commit
f5c86bc457
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user