Commit 4af3239f authored by Krophil's avatar Krophil
Browse files

fix can_buy in customer

parent 23d86464
Pipeline #1433 canceled with stage
in 4 minutes and 15 seconds
......@@ -71,7 +71,7 @@ class Customer(models.Model):
@property
def can_buy(self):
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):
number = str(number)
......
Supports Markdown
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