Define id
This commit is contained in:
parent
b51fb2d6de
commit
073f4bba11
2 changed files with 4 additions and 0 deletions
|
@ -158,6 +158,8 @@ class OrderItem(db.Model):
|
||||||
return False
|
return False
|
||||||
if self.user is not None and self.user_id == user_id:
|
if self.user is not None and self.user_id == user_id:
|
||||||
return True
|
return True
|
||||||
|
if user_id is None:
|
||||||
|
return False
|
||||||
user = User.query.filter(User.id == user_id).first()
|
user = User.query.filter(User.id == user_id).first()
|
||||||
if user and user.is_admin():
|
if user and user.is_admin():
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -37,6 +37,8 @@ def handle401(e):
|
||||||
|
|
||||||
|
|
||||||
class AnonymouseUser:
|
class AnonymouseUser:
|
||||||
|
id = None
|
||||||
|
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue