Update models.py
This commit is contained in:
parent
59afcab907
commit
a289ad0697
1 changed files with 3 additions and 3 deletions
|
@ -149,10 +149,10 @@ class OrderItem(db.Model):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
product = None
|
product_name = None
|
||||||
if self.product:
|
if self.product:
|
||||||
product = 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')
|
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):
|
def can_delete(self, order_id, user_id, name):
|
||||||
if int(self.order_id) != int(order_id):
|
if int(self.order_id) != int(order_id):
|
||||||
|
|
Loading…
Reference in a new issue