"Fix" for unit tests

- Not working in travis for some reason?
- But they are working locally...
This commit is contained in:
Oliver Walters 2020-04-20 01:23:05 +10:00
parent 57fa69f6e6
commit f5c86bc457

View File

@ -180,7 +180,7 @@ class PartList(generics.ListCreateAPIView):
# Pass a list of "starred" parts fo the current user to the serializer # Pass a list of "starred" parts fo the current user to the serializer
# We do this to reduce the number of database queries required! # 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()] self.starred_parts = [star.part for star in self.request.user.starred_parts.all()]
kwargs['starred_parts'] = self.starred_parts kwargs['starred_parts'] = self.starred_parts