From bf33a80042cc76e2cbc36991330d7dbbd7a33db4 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Mon, 3 May 2021 17:14:45 +0530 Subject: [PATCH] fix(setup): do not show messsage when exception is handled (cherry picked from commit ac9fe71733af5fe944cbca62dd688d2e49254497) --- frappe/translate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frappe/translate.py b/frappe/translate.py index 4baf4bdd89..5c5480d0a2 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -540,8 +540,12 @@ def extract_messages_from_code(code): try: code = frappe.as_unicode(render_include(code)) - except (TemplateError, ImportError, InvalidIncludePath, IOError): - # Exception will occur when it encounters John Resig's microtemplating code + + # Exception will occur when it encounters John Resig's microtemplating code + except (TemplateError, ImportError, InvalidIncludePath, IOError) as e: + if isinstance(e, InvalidIncludePath): + frappe.clear_last_message() + pass messages = []