fix can_buy in customer

This commit is contained in:
Pierre Brunet 2017-12-01 01:13:02 +01:00
parent 23d86464c8
commit 4af3239f4c

View File

@ -71,7 +71,7 @@ class Customer(models.Model):
@property @property
def can_buy(self): def can_buy(self):
return (self.user.subscriptions.last() and return (self.user.subscriptions.last() and
(date.today() - self.user.subscriptions.last().subscription_end) < timedelta(days=90)) (date.today() - self.user.subscriptions.order_by('subscription_end').last().subscription_end) < timedelta(days=90))
def generate_account_id(number): def generate_account_id(number):
number = str(number) number = str(number)