Bug fix in email_campaign's update_status function. (#45679)

During the scheduler event of set_email_campaign_status, the function calling update_status isn't saving the modified status field.
This commit is contained in:
harshpwctech
2025-02-07 13:13:19 +05:30
committed by GitHub
parent b80b5574d3
commit 88e68bb803

View File

@@ -78,11 +78,11 @@ class EmailCampaign(Document):
end_date = getdate(self.end_date)
today_date = getdate(today())
if start_date > today_date:
self.status = "Scheduled"
self.db_set("status", "Scheduled", update_modified=False)
elif end_date >= today_date:
self.status = "In Progress"
self.db_set("status", "In Progress", update_modified=False)
elif end_date < today_date:
self.status = "Completed"
self.db_set("status", "Completed", update_modified=False)
# called through hooks to send campaign mails to leads