[IMP] mass_mailing_unique: informative constraint

pull/522/head
david 2020-03-13 16:23:05 +01:00
parent 529240921a
commit 4bd9a0b492
1 changed files with 4 additions and 2 deletions

View File

@ -18,5 +18,7 @@ class MailMassMailingContact(models.Model):
contact_email = contact.email.strip().lower() contact_email = contact.email.strip().lower()
other_emails = [e.strip().lower() for e in others.mapped('email')] other_emails = [e.strip().lower() for e in others.mapped('email')]
if contact_email in other_emails: if contact_email in other_emails:
raise ValidationError(_("Cannot have the same email more " raise ValidationError(_(
"than once in the same list")) "Cannot have the same email (%s) more"
"than once in the same list." % contact_email
))