fossasia / open-event-server

Consider using in PYL-R1714
Performance
Major
3 occurrences in this check
Consider merging these comparisons with "in" to "ticket.type in ('paid', 'donation')"
250        :param view_kwargs:
251        :return:
252        """
253        if ticket.type == 'paid' or ticket.type == 'donation':254            try:
255                event = (
256                    db.session.query(Event)
Consider merging these comparisons with "in" to "data.get('type') in ('paid', 'donation')"
 96                    {'event_id': data['event']}, "Event does not exist"
 97                )
 98
 99            if data.get('type') == 'paid' or data.get('type') == 'donation':100                if not event.is_payment_enabled():
101                    raise UnprocessableEntityError(
102                        {'event_id': data['event']},
Consider merging these comparisons with "in" to "order.status in ('cancelled', 'expired', 'completed')"
33                ),
34            )
35        if (
36            order.status == 'cancelled'37            or order.status == 'expired'
38            or order.status == 'completed'
39        ):