mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Catch case in which a request.GET is not available
(cherry picked from commit 9296c0ba0f8c4914cd04b820c6172f8c3a794750)
This commit is contained in:
@ -261,8 +261,12 @@ class StockList(generics.ListCreateAPIView):
|
||||
|
||||
def get_serializer(self, *args, **kwargs):
|
||||
|
||||
part_detail = str2bool(self.request.GET.get('part_detail', None))
|
||||
location_detail = str2bool(self.request.GET.get('location_detail', None))
|
||||
try:
|
||||
part_detail = str2bool(self.request.GET.get('part_detail', None))
|
||||
location_detail = str2bool(self.request.GET.get('location_detail', None))
|
||||
except AttributeError:
|
||||
part_detail = None
|
||||
location_detail = None
|
||||
|
||||
kwargs['part_detail'] = part_detail
|
||||
kwargs['location_detail'] = location_detail
|
||||
|
Reference in New Issue
Block a user