Fix create user after create subscribe with same email

remotes/origin/hasaccess
Ivlev Denis 8 years ago
parent 8dd4374cee
commit 6336d07e84
  1. 3
      apps/user/models.py

@ -112,6 +112,9 @@ def send_user_info_to_mixpanel(sender, instance=None, created=False, **kwargs):
def auto_create_subscription(sender, instance=None, created=False, **kwargs):
try:
es = EmailSubscription.objects.get(email=instance.email)
if not es.user:
es.user = instance
es.save()
except EmailSubscription.DoesNotExist:
instance.email_subscription = EmailSubscription.objects.create(
user=instance,

Loading…
Cancel
Save