Skip to content

Commit

Permalink
fix: add check if donation ticket has payment method enabled (#6789)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored and iamareebjamal committed Jan 26, 2020
1 parent 1559c4c commit ac1ae07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/tickets.py
Expand Up @@ -70,7 +70,7 @@ def before_create_object(self, data, view_kwargs):
{'event_id': data['event']}, "Event does not exist"
)

if data.get('type') == 'paid':
if data.get('type') == 'paid' or data.get('type') == 'donation':
if not event.is_payment_enabled():
raise UnprocessableEntity(
{'event_id': data['event']},
Expand Down Expand Up @@ -231,7 +231,7 @@ def before_update_object(self, ticket, data, view_kwargs):
:param view_kwargs:
:return:
"""
if ticket.type == 'paid':
if ticket.type == 'paid' or ticket.type == 'donation':
try:
event = (
db.session.query(Event)
Expand Down

0 comments on commit ac1ae07

Please sign in to comment.