From 7bf6c19a31d13edf1c1afa47cb674a5543fc3a57 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Thu, 17 Aug 2017 10:59:26 +0530 Subject: [PATCH 1/2] [hotfix] daily_emails limit fixes (#3942) --- frappe/commands/site.py | 2 +- frappe/email/queue.py | 2 +- frappe/patches/v8_7/update_email_queue_status.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/commands/site.py b/frappe/commands/site.py index fafbb25fc5..05c3ff4dc5 100755 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -460,7 +460,7 @@ def _set_limits(context, site, limits): elif limit=='space': value = float(value) - elif limit in ('users', 'emails', 'email_group'): + elif limit in ('users', 'emails', 'email_group', 'daily_emails'): value = int(value) new_limits[limit] = value diff --git a/frappe/email/queue.py b/frappe/email/queue.py index f71e25fd46..5ef75a0df7 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -218,7 +218,7 @@ def check_email_limit(recipients): or frappe.flags.in_test): monthly_email_limit = frappe.conf.get('limits', {}).get('emails') - daily_email_limit = frappe.conf.get('limits', {}).get('daily_emails') + daily_email_limit = cint(frappe.conf.get('limits', {}).get('daily_emails')) if frappe.flags.in_test: monthly_email_limit = 500 diff --git a/frappe/patches/v8_7/update_email_queue_status.py b/frappe/patches/v8_7/update_email_queue_status.py index 8dcbcc57d6..1e9be8e3cc 100644 --- a/frappe/patches/v8_7/update_email_queue_status.py +++ b/frappe/patches/v8_7/update_email_queue_status.py @@ -7,7 +7,7 @@ def execute(): default_email_account = get_default_outgoing_email_account() if frappe.conf.get("google_analytics_id") == "UA-8911157-19" or \ - default_email_account.email_id == "notifications@erpnext.com": + (default_email_account and default_email_account.email_id == "notifications@erpnext.com"): frappe.db.sql("""update `tabEmail Queue` set status='Not Sent' where creation>=DATE_SUB(NOW(), INTERVAL 16 HOUR)""") \ No newline at end of file From e6f89d91b6414a21e08c5b44174edc3c1aa13c66 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Thu, 17 Aug 2017 11:30:37 +0600 Subject: [PATCH 2/2] bumped to version 8.7.8 --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index b0fd570187..8206ba4946 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -14,7 +14,7 @@ import os, sys, importlib, inspect, json from .exceptions import * from .utils.jinja import get_jenv, get_template, render_template, get_email_from_template -__version__ = '8.7.7' +__version__ = '8.7.8' __title__ = "Frappe Framework" local = Local()