do not send email digests to expired accounts
This commit is contained in:
parent
86e240177e
commit
2e6e0963d0
@ -338,8 +338,14 @@ class DocType:
|
||||
|
||||
def send():
|
||||
from webnotes.model.code import get_obj
|
||||
from webnotes.utils import getdate
|
||||
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`
|
||||
where enabled=1 and docstatus<2""", as_list=1):
|
||||
ed_obj = get_obj('Email Digest', ed[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user