Skip to content

Instantly share code, notes, and snippets.

@kidig kidig/

Created Aug 3, 2017
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 =
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.