Commit f8f49323 authored by fred's avatar fred

ignore concurrent subscribe calls

parent e23f20cf
......@@ -11,7 +11,7 @@ from email.mime.text import MIMEText
import html2text
from django.db import models
from django.db import models, IntegrityError
from django.core.urlresolvers import reverse
from django.template import loader
......@@ -45,7 +45,11 @@ class Subscriber(models.Model) :
existing_subscriber.is_registered = None
existing_subscriber.save()
else:
super(Subscriber, self).save(*args, **kwargs)
try:
super(Subscriber, self).save(*args, **kwargs)
except IntegrityError:
# probably concurrent calls, skip that.
return
if self.is_validated is None:
self.send_confirmation_email()
......
Markdown is supported
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