Define id

This commit is contained in:
Feliciaan De Palmenaer 2015-11-05 17:15:03 +01:00
parent b51fb2d6de
commit 073f4bba11
2 changed files with 4 additions and 0 deletions

View file

@ -158,6 +158,8 @@ class OrderItem(db.Model):
return False
if self.user is not None and self.user_id == user_id:
return True
if user_id is None:
return False
user = User.query.filter(User.id == user_id).first()
if user and user.is_admin():
return True

View file

@ -37,6 +37,8 @@ def handle401(e):
class AnonymouseUser:
id = None
def is_active(self):
return False