ソースを参照

fix: remove example users email ids from notifications

currently the system tries sending emails to all users that have
'thread_notify' enabled, including the default example emails that the
Administrator and Guest accounts have. this patch disables email
notifications for these accounts, and additionally tries to disable it
for any other user accounts with example emails

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
version-14
Chinmay D. Pai 5年前
コミット
f12ed9791a
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 75507BE256F40CED
3個のファイルの変更14行の追加3行の削除
  1. +2
    -1
      frappe/patches.txt
  2. +8
    -0
      frappe/patches/v12_0/remove_example_email_thread_notify.py
  3. +4
    -2
      frappe/utils/install.py

+ 2
- 1
frappe/patches.txt ファイルの表示

@@ -273,6 +273,7 @@ execute:frappe.delete_doc_if_exists('DocType', 'GSuite Templates')
execute:frappe.delete_doc_if_exists('DocType', 'GCalendar Account')
execute:frappe.delete_doc_if_exists('DocType', 'GCalendar Settings')
frappe.patches.v12_0.remove_parent_and_parenttype_from_print_formats
frappe.patches.v12_0.remove_example_email_thread_notify
execute:from frappe.desk.page.setup_wizard.install_fixtures import update_genders;update_genders()
frappe.patches.v12_0.set_correct_url_in_files
frappe.patches.v13_0.website_theme_custom_scss
@@ -293,4 +294,4 @@ execute:frappe.delete_doc("DocType", "Onboarding Slide Help Link")
frappe.patches.v13_0.update_date_filters_in_user_settings
frappe.patches.v13_0.update_duration_options
frappe.patches.v13_0.replace_old_data_import # 2020-06-24
frappe.patches.v13_0.create_custom_dashboards_cards_and_charts
frappe.patches.v13_0.create_custom_dashboards_cards_and_charts

+ 8
- 0
frappe/patches/v12_0/remove_example_email_thread_notify.py ファイルの表示

@@ -0,0 +1,8 @@
import frappe


def execute():
# remove all example.com email user accounts from notifications
frappe.db.sql("""UPDATE `tabUser`
SET thread_notify=0, send_me_a_copy=0
WHERE email like '%@example.com'""")

+ 4
- 2
frappe/utils/install.py ファイルの表示

@@ -50,11 +50,13 @@ def install_basic_docs():
install_docs = [
{'doctype':'User', 'name':'Administrator', 'first_name':'Administrator',
'email':'admin@example.com', 'enabled':1, "is_admin": 1,
'roles': [{'role': 'Administrator'}]
'roles': [{'role': 'Administrator'}],
'thread_notify': 0, 'send_me_a_copy': 0
},
{'doctype':'User', 'name':'Guest', 'first_name':'Guest',
'email':'guest@example.com', 'enabled':1, "is_guest": 1,
'roles': [{'role': 'Guest'}]
'roles': [{'role': 'Guest'}],
'thread_notify': 0, 'send_me_a_copy': 0
},
{'doctype': "Role", "role_name": "Report Manager"},
{'doctype': "Role", "role_name": "Translator"},


読み込み中…
キャンセル
保存