diff --git a/app/api/orders.py b/app/api/orders.py index 5b06744b73..9215f17a57 100644 --- a/app/api/orders.py +++ b/app/api/orders.py @@ -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") @@ -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