You didn't see this

This commit is contained in:
Midgard 2022-05-02 22:00:37 +02:00
parent 85d8892176
commit a568103a60
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -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)