do not send email digests to expired accounts

This commit is contained in:
Anand Doshi 2012-10-03 09:18:16 +05:30
parent 86e240177e
commit 2e6e0963d0

View File

@ -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])