diff --git a/counter/models.py b/counter/models.py index 46b7ceae..aff1f2b5 100644 --- a/counter/models.py +++ b/counter/models.py @@ -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