mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
do not send email digests to expired accounts
This commit is contained in:
@@ -338,8 +338,14 @@ class DocType:
|
|||||||
|
|
||||||
def send():
|
def send():
|
||||||
from webnotes.model.code import get_obj
|
from webnotes.model.code import get_obj
|
||||||
|
from webnotes.utils import getdate
|
||||||
now_date = now_datetime().date()
|
now_date = now_datetime().date()
|
||||||
|
|
||||||
|
import conf
|
||||||
|
if hasattr(conf, "expires_on") and now_date > getdate(conf.expires_on):
|
||||||
|
# do not send email digests to expired accounts
|
||||||
|
return
|
||||||
|
|
||||||
for ed in webnotes.conn.sql("""select name from `tabEmail Digest`
|
for ed in webnotes.conn.sql("""select name from `tabEmail Digest`
|
||||||
where enabled=1 and docstatus<2""", as_list=1):
|
where enabled=1 and docstatus<2""", as_list=1):
|
||||||
ed_obj = get_obj('Email Digest', ed[0])
|
ed_obj = get_obj('Email Digest', ed[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user