From da95b484dbddc083a16857ead5920eac8a6288ab Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 22 Jun 2016 13:10:23 +0530 Subject: [PATCH] [fix] merge fixes and test --- frappe/email/doctype/email_account/test_email_account.py | 2 +- frappe/email/queue.py | 2 +- frappe/hooks.py | 2 +- frappe/limits.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frappe/email/doctype/email_account/test_email_account.py b/frappe/email/doctype/email_account/test_email_account.py index df4e10f8d9..53e405a27b 100644 --- a/frappe/email/doctype/email_account/test_email_account.py +++ b/frappe/email/doctype/email_account/test_email_account.py @@ -108,7 +108,7 @@ class TestEmailAccount(unittest.TestCase): def test_sendmail(self): frappe.flags.sent_mail = None frappe.sendmail(sender="test_sender@example.com", recipients="test_recipient@example.com", - content="test mail 001", subject="test-mail-001") + content="test mail 001", subject="test-mail-001", delayed=False) sent_mail = email.message_from_string(frappe.flags.sent_mail) self.assertTrue("test-mail-001" in sent_mail.get("Subject")) diff --git a/frappe/email/queue.py b/frappe/email/queue.py index f8eccb2728..c0859352af 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -338,4 +338,4 @@ def clear_outbox(): def prevent_bulk_email_delete(doc, method): from frappe.limits import get_limits if frappe.session.user != 'Administrator' and get_limits().get('block_bulk_email_delete'): - frappe.throw(_('Only Administrator can delete Bulk Email')) \ No newline at end of file + frappe.throw(_('Only Administrator can delete Email Queue')) \ No newline at end of file diff --git a/frappe/hooks.py b/frappe/hooks.py index 771829aa39..c537d814fa 100755 --- a/frappe/hooks.py +++ b/frappe/hooks.py @@ -99,7 +99,7 @@ doc_events = { "User": { "validate": "frappe.utils.user.validate_user_limit" }, - "Bulk Email": { + "Email Queue": { "on_trash": "frappe.email.bulk.prevent_bulk_email_delete" }, "*": { diff --git a/frappe/limits.py b/frappe/limits.py index 9f671902fa..6ad8445973 100755 --- a/frappe/limits.py +++ b/frappe/limits.py @@ -35,7 +35,7 @@ def check_if_expired(): # if expired, stop user from logging in expires_on = formatdate(get_limits().get("expiry")) support_email = get_limits().get("support_email") or _("your provider") - + frappe.throw(_("""Your subscription expired on {0}. To extend please send an email to {1}""").format(expires_on, support_email), SiteExpiredError) @@ -72,7 +72,7 @@ def get_expiry_message(): def get_limits(): limits = frappe.get_conf().get("limits") or {} day = frappe.utils.add_months(frappe.utils.today(), -1) - limits["bulk_count"] = frappe.db.count("Bulk Email", filters={'creation': ['>', day]}) + limits["bulk_count"] = frappe.db.count("Email Queue", filters={'creation': ['>', day]}) return limits