We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 006110f commit 0a0e2c4Copy full SHA for 0a0e2c4
app/api/schema/tickets.py
@@ -67,6 +67,12 @@ def validate_quantity(self, data):
67
raise UnprocessableEntity({'pointer': '/data/attributes/quantity'},
68
"quantity should be greater than or equal to max-order")
69
70
+ @validates_schema
71
+ def validate_price(self, data):
72
+ if data['type'] == 'paid' and ('price' not in data or data['price'] <= 0):
73
+ raise UnprocessableEntity({'pointer': 'data/attributes/price'},
74
+ "paid ticket price should be greater than 0")
75
+
76
@validates_schema(pass_original=True)
77
def validate_discount_code(self, data, original_data):
78
if 'relationships' in original_data and 'discount-codes' in original_data['data']['relationships']:
0 commit comments