mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
unify account_id creation
This commit is contained in:
@ -24,7 +24,6 @@
|
||||
|
||||
from datetime import date, timedelta
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
@ -101,8 +100,8 @@ class Subscription(models.Model):
|
||||
super(Subscription, self).save()
|
||||
from counter.models import Customer
|
||||
|
||||
if not Customer.objects.filter(user=self.member).exists():
|
||||
Customer.new_for_user(self.member).save()
|
||||
_, created = Customer.get_or_create(self.member)
|
||||
if created:
|
||||
form = PasswordResetForm({"email": self.member.email})
|
||||
if form.is_valid():
|
||||
form.save(
|
||||
|
Reference in New Issue
Block a user