mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 18:44:23 +00:00
counter: fix Selling view permission
This commit is contained in:
parent
a6088c0e4a
commit
566dcc7aee
@ -478,7 +478,9 @@ class Selling(models.Model):
|
|||||||
return user.is_owner(self.counter) and self.payment_method != "CARD"
|
return user.is_owner(self.counter) and self.payment_method != "CARD"
|
||||||
|
|
||||||
def can_be_viewed_by(self, user):
|
def can_be_viewed_by(self, user):
|
||||||
if not hasattr(self, "customer"): # Customer can be set to Null
|
if (
|
||||||
|
not hasattr(self, "customer") or self.customer is None
|
||||||
|
): # Customer can be set to Null
|
||||||
return False
|
return False
|
||||||
return user == self.customer.user
|
return user == self.customer.user
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user