Skip to content

Commit d93dd98

Browse files
fix api doc cash customer id
1 parent 0d02307 commit d93dd98

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)