From d5b1c7f9b94b859bddbca03a1b742a9be656817f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 15 Jun 2011 13:05:08 +0530 Subject: [PATCH] modified the recipient list fetch logic --- cgi-bin/webnotes/utils/backups.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cgi-bin/webnotes/utils/backups.py b/cgi-bin/webnotes/utils/backups.py index 86a6e210ac..82cc69510a 100644 --- a/cgi-bin/webnotes/utils/backups.py +++ b/cgi-bin/webnotes/utils/backups.py @@ -56,11 +56,12 @@ class BackupGenerator: """ Get recepient's email address """ - import webnotes.db - webnotes.conn = webnotes.db.Database(use_default = 1) - recipient_list = webnotes.conn.sql("""SELECT parent FROM tabUserRole - WHERE role='System Manager' - AND parent!='Administrator'""") + recipient_list = webnotes.conn.sql(\ + """SELECT parent FROM tabUserRole + WHERE role='System Manager' + AND parent!='Administrator' + AND parent IN + (SELECT email FROM tabProfile WHERE enabled=1)""") return [i[0] for i in recipient_list]