counter: fix eticket server crash induced by old permission system and fix Selling permission

This commit is contained in:
2019-10-16 21:21:51 +02:00
parent 811809895e
commit 241650c171
2 changed files with 7 additions and 1 deletions

View File

@ -478,6 +478,8 @@ 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
return False
return user == self.customer.user
def delete(self, *args, **kwargs):