From 2208c44a8d5540c54972cecd74bf63b984453efb Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Mon, 19 Feb 2018 21:34:54 +0100 Subject: [PATCH] Fix crash in admin panel --- app/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 35f74d3..2507e82 100644 --- a/app/models.py +++ b/app/models.py @@ -91,7 +91,10 @@ class Order(db.Model): self.stoptime = stoptime def __repr__(self): - return 'Order %d @ %s' % (self.id, self.location.name or 'None') + if self.location: + return 'Order %d @ %s' % (self.id, self.location.name or 'None') + else: + return 'Order %d' % (self.id) def group_by_user(self): group = dict()