Skip to content

Commit d078de1

Browse files
Merge pull request #70 from usermicrodevices/develop
fix api doc cash customer id
2 parents 6c8ae51 + d93dd98 commit d078de1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

api/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ def post(self, request, *args, **kwargs):
277277
if not isinstance(customer, dict):
278278
self.logw(customer, 'CUSTOMER MUST BE AS DICTIONARY')
279279
else:
280-
if customer.get('id', None):
280+
id_customer = customer.get('id', None)
281+
if id_customer is not None and Customer.objects.filter(id=id_customer).exists():
281282
doc.customer_id = id_customer
282283
else:
283284
customer_name = customer.get('name', '')

0 commit comments

Comments
 (0)