mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix for project API
If project is not specified in URL, take value from JSON
This commit is contained in:
parent
b13f135d8e
commit
817a67cd41
@ -67,7 +67,9 @@ class ProjectPartsList(generics.ListCreateAPIView):
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
# Ensure project link is set correctly
|
||||
request.data['project'] = self.request.query_params.get('project', None)
|
||||
prj_id = self.request.query_params.get('project', None)
|
||||
if prj_id:
|
||||
request.data['project'] = prj_id
|
||||
return super(ProjectPartsList, self).create(request, *args, **kwargs)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user