Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/api/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def check_billing_info(data):
raise UnprocessableEntity({'pointer': '/data/attributes/is_billing_enabled'},
"Billing information is mandatory for paid orders")
if data.get('is_billing_enabled') and not (data.get('company') and data.get('address') and data.get('city') and
data.get('zip') and data.get('country')):
data.get('zipcode') and data.get('country')):
raise UnprocessableEntity({'pointer': '/data/attributes/is_billing_enabled'},
"Billing information incomplete")

Expand Down Expand Up @@ -106,7 +106,8 @@ def before_create_object(self, data, view_kwargs):
:param view_kwargs:
:return:
"""
check_billing_info(data)
if data.get('amount') > 0 and not data.get('is_billing_enabled'):
data['is_billing_enabled'] = True

free_ticket_quantity = 0

Expand Down