Fix crash in admin panel

This commit is contained in:
Feliciaan De Palmenaer 2018-02-19 21:34:54 +01:00 committed by GitHub
parent d41be22d42
commit 2208c44a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,7 +91,10 @@ class Order(db.Model):
self.stoptime = stoptime self.stoptime = stoptime
def __repr__(self): 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): def group_by_user(self):
group = dict() group = dict()