2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-09 07:00:56 +00:00
Thanks, unit testing
This commit is contained in:
Oliver Walters
2020-04-06 11:21:34 +10:00
parent b28487760a
commit bbe714c8f7
3 changed files with 10 additions and 6 deletions

View File

@ -61,11 +61,15 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView):
def get_serializer(self, *args, **kwargs):
part_detail = str2bool(self.request.GET.get('part_detail', False))
loc_detail = str2bool(self.request.GET.get('location_detail', False))
try:
kwargs['part_detail'] = str2bool(self.request.GET.get('part_detail', False))
except AttributeError:
pass
kwargs['part_detail'] = part_detail
kwargs['location_detail'] = loc_detail
try:
kwargs['location_detail'] = str2bool(self.request.GET.get('location_detail', False))
except AttributeError:
pass
kwargs['context'] = self.get_serializer_context()