Merge pull request #1929 from nabinhait/email_group_fix

[patch] Set Email Group based on Newsletter list value
This commit is contained in:
Nabin Hait 2016-08-01 18:57:04 +05:30 committed by GitHub
commit 47f53cf99e
2 changed files with 12 additions and 1 deletions

View file

@ -135,4 +135,4 @@ execute:frappe.db.sql("delete from `tabWeb Page` where ifnull(template_path, '')
frappe.patches.v7_0.re_route #2016-06-27
frappe.patches.v7_0.rename_newsletter_list_to_email_group
frappe.patches.v7_0.replace_upgrade_link_limit
execute:frappe.db.sql("update `tabEmail Group Member` set email_group = newsletter_list where email_group is null or email_group = ''")
frappe.patches.v7_0.set_email_group

View file

@ -0,0 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("email", "doctype", "email_group_member")
if "newsletter_list" in frappe.db.get_table_columns("Email Group Member"):
frappe.db.sql("""update `tabEmail Group Member` set email_group = newsletter_list
where email_group is null or email_group = ''""")