Skip to content

Instantly share code, notes, and snippets.

@kidig kidig/test.py
Created Aug 3, 2017

Embed
What would you like to do?
finish_statuses = ['finished', 'cancelled']
if self.status == self.STATUS_FINISHED:
if not self.event_type == self.TYPE_DELIVERY:
delivery = self.booking.booking_events.filter(event_type=self.TYPE_DELIVERY).first()
if delivery and delivery.status not in [finish_statuses]:
raise ValidationError({'status': ['Please finish/cancel delivery event first.']})
# delivery.status = 'finished'
# but
# delivery.status not in [finish_statuses] is FALSE!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.