Merge branch 'master' of github.com:ZeusWPI/Haldis

This commit is contained in:
Rien Maertens 2016-02-09 01:09:39 +01:00
commit bea56b6a1e

View file

@ -149,7 +149,10 @@ class OrderItem(db.Model):
return self.name
def __repr__(self):
return 'Order %d: %s wants %s' % (self.order_id or 0, self.get_name(), self.product.name or 'None')
product_name = None
if self.product:
product_name = self.product.name
return 'Order %d: %s wants %s' % (self.order_id or 0, self.get_name(), product_name or 'None')
def can_delete(self, order_id, user_id, name):
if int(self.order_id) != int(order_id):