mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
fix: allow only 1 active Email Campaign for a lead/contact at a time
This commit is contained in:
@@ -42,7 +42,7 @@ class EmailCampaign(Document):
|
|||||||
frappe.throw(_("Please set an email id for lead communication"))
|
frappe.throw(_("Please set an email id for lead communication"))
|
||||||
|
|
||||||
def validate_email_campaign_already_exists(self):
|
def validate_email_campaign_already_exists(self):
|
||||||
if frappe.db.get_value("Email Campaign", {"campaign_name": self.campaign_name, "recipient": self.recipient, "status": "Active"}):
|
if frappe.db.get_value("Email Campaign", {"campaign_name": self.campaign_name, "recipient": self.recipient, "status": "In Progress"}):
|
||||||
frappe.throw(_("The Campaign '{0}' already exists for the {1} '{2}'").format(self.campaign_name, self.email_campaign_for, self.recipient))
|
frappe.throw(_("The Campaign '{0}' already exists for the {1} '{2}'").format(self.campaign_name, self.email_campaign_for, self.recipient))
|
||||||
|
|
||||||
def update_status(self):
|
def update_status(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user