You didn't see this
This commit is contained in:
parent
85d8892176
commit
a568103a60
1 changed files with 2 additions and 6 deletions
|
@ -118,13 +118,9 @@ class Order(db.Model):
|
|||
def can_modify_prices(self, user_id: int) -> bool:
|
||||
if not self.is_closed():
|
||||
return False
|
||||
if user_id is None:
|
||||
return False
|
||||
if self.courier_id == user_id:
|
||||
return True
|
||||
user = User.query.filter_by(id=user_id).first()
|
||||
return user and user.is_admin()
|
||||
return user and (user.is_admin() or user == self.courier)
|
||||
|
||||
def can_modify_payment(self, user_id: int) -> bool:
|
||||
user = User.query.filter_by(id=user_id).first()
|
||||
return user and (user.is_admin() or user == self.order.courier)
|
||||
return user and (user.is_admin() or user == self.courier)
|
||||
|
|
Loading…
Reference in a new issue