[fix] newsletter list unique check

This commit is contained in:
Nabin Hait 2015-08-03 17:26:37 +05:30
parent f2e5e7fc22
commit c3e1f6bb96

View File

@ -34,10 +34,8 @@ class NewsletterList(Document):
}).insert(ignore_permissions=True) }).insert(ignore_permissions=True)
added += 1 added += 1
except Exception, e: except frappe.UniqueValidationError:
# already added, ignore pass
if e.args[0]!=1062:
raise
frappe.msgprint(_("{0} subscribers added").format(added)) frappe.msgprint(_("{0} subscribers added").format(added))