Verified Commit 566dcc7a authored by Sli's avatar Sli
Browse files

counter: fix Selling view permission

parent a6088c0e
Pipeline #2103 passed with stage
in 43 minutes and 20 seconds
......@@ -478,7 +478,9 @@ class Selling(models.Model):
return user.is_owner(self.counter) and self.payment_method != "CARD"
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 user == self.customer.user
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment