Skip to content

Commit

Permalink
Do not call the supplier when the SKU field is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeoLacruz committed May 24, 2024
1 parent 162178f commit afde7fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inventree_supplier_panel/supplier_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ def transfer_cart(self, request, pk):
# ---------------------------- add_supplierpart -------------------------------
def add_supplierpart(self, request):
data = json.loads(request.body)
self.part_data = self.get_partdata(data['supplier'], data['sku'])
if (data['sku'] == ''):
self.status_code = 'Please provide part number'
return HttpResponse('OK')
self.part_data = self.get_partdata(data['supplier'], data['sku'])
if (self.status_code != 200):
return HttpResponse('OK')
part = Part.objects.filter(id=data['pk']).all()[0]
Expand Down

0 comments on commit afde7fd

Please sign in to comment.