Migrate and improve subscriptions

This commit is contained in:
Skia
2016-08-14 19:28:14 +02:00
parent e1474c7a74
commit 66fdf6cbf7
18 changed files with 351 additions and 89 deletions

View File

@ -53,7 +53,8 @@ class Subscription(models.Model):
super(Subscription, self).save()
from counter.models import Customer
if not Customer.objects.filter(user=self.member).exists():
Customer(user=self.member, account_id=Customer.generate_account_id(self.id), amount=0).save()
last_id = Customer.objects.count() + 5195 # Number to keep a continuity with the old site
Customer(user=self.member, account_id=Customer.generate_account_id(last_id+1), amount=0).save()
self.member.make_home()
def get_absolute_url(self):