From 276f5b56314b41e6221d1dfe2839004362a0e2d5 Mon Sep 17 00:00:00 2001 From: pratu16x7 Date: Tue, 5 Sep 2017 12:15:43 +0530 Subject: [PATCH] [setup] suppress post-setup messages --- frappe/core/doctype/user/user.py | 4 +++- frappe/email/smtp.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/user/user.py b/frappe/core/doctype/user/user.py index 923ae43582..8b5cac2dd5 100644 --- a/frappe/core/doctype/user/user.py +++ b/frappe/core/doctype/user/user.py @@ -112,7 +112,9 @@ class User(Document): self.get("roles")]): return - if self.name not in STANDARD_USERS and self.user_type == "System User" and not self.get_other_system_managers(): + if (self.name not in STANDARD_USERS and self.user_type == "System User" and not self.get_other_system_managers() + and cint(frappe.db.get_single_value('System Settings', 'setup_complete'))): + msgprint(_("Adding System Manager to this User as there must be atleast one System Manager")) self.append("roles", { "doctype": "Has Role", diff --git a/frappe/email/smtp.py b/frappe/email/smtp.py index 20a4a670a6..db82d937ee 100644 --- a/frappe/email/smtp.py +++ b/frappe/email/smtp.py @@ -53,7 +53,7 @@ def get_outgoing_email_account(raise_exception_not_set=True, append_to=None): if not email_account: email_account = get_default_outgoing_email_account(raise_exception_not_set=raise_exception_not_set) - if not email_account and raise_exception_not_set: + if not email_account and raise_exception_not_set and cint(frappe.db.get_single_value('System Settings', 'setup_complete')): frappe.throw(_("Please setup default Email Account from Setup > Email > Email Account"), frappe.OutgoingEmailError)