From bf931598a20f9110f0c1fcb59305f927f6f1e4e2 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Mon, 1 Apr 2024 21:42:12 +0530 Subject: [PATCH] Revert "Merge pull request #25755 from akhilnarang/optional-skip-msgprint" This reverts commit f8121b99dfc43d7a9f936420ed5951f385e5e9d9, reversing changes made to 14e2d959476c347c1b6ea51723cb4ab75b4d3754. --- frappe/__init__.py | 7 +------ frappe/desk/doctype/event/event.py | 2 +- frappe/utils/data.py | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index d1b7287233..77b840412e 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -565,7 +565,6 @@ def msgprint( primary_action: str | None = None, is_minimizable: bool = False, wide: bool = False, - skip_msgprint: bool = False, *, realtime=False, ) -> None: @@ -581,7 +580,6 @@ def msgprint( :param primary_action: [optional] Bind a primary server/client side action. :param is_minimizable: [optional] Allow users to minimize the modal :param wide: [optional] Show wide modal - :param skip_msgprint: [optional] Skip showing message using `msgprint` - only raise exception. :param realtime: Publish message immediately using websocket. """ import inspect @@ -600,7 +598,7 @@ def msgprint( exc.__frappe_exc_id = out.__frappe_exc_id raise exc - if flags.mute_messages or skip_msgprint: + if flags.mute_messages: _raise_exception() return @@ -671,7 +669,6 @@ def throw( wide: bool = False, as_list: bool = False, primary_action=None, - skip_msgprint: bool = False, ) -> None: """Throw execption and show message (`msgprint`). @@ -682,7 +679,6 @@ def throw( :param wide: [optional] Show wide modal :param as_list: [optional] If `msg` is a list, render as un-ordered list. :param primary_action: [optional] Bind a primary server/client side action. - :param skip_msgprint: [optional] Skip showing message using `msgprint`. """ msgprint( msg, @@ -693,7 +689,6 @@ def throw( wide=wide, as_list=as_list, primary_action=primary_action, - skip_msgprint=skip_msgprint, ) diff --git a/frappe/desk/doctype/event/event.py b/frappe/desk/doctype/event/event.py index 968bd757e3..0765ad9f50 100644 --- a/frappe/desk/doctype/event/event.py +++ b/frappe/desk/doctype/event/event.py @@ -451,7 +451,7 @@ def get_events(start, end, user=None, for_reminder=False, filters=None) -> list[ # last day of month issue, start from prev month! try: - getdate(date, skip_msgprint=True) + getdate(date) except Exception: date = date.split("-") date = date[0] + "-" + str(cint(date[1]) - 1) + "-" + date[2] diff --git a/frappe/utils/data.py b/frappe/utils/data.py index aa791c73b7..748e0c8954 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -101,9 +101,7 @@ def is_invalid_date_string(date_string: str) -> bool: def getdate( - string_date: Optional["DateTimeLikeObject"] = None, - parse_day_first: bool = False, - skip_msgprint: bool = False, + string_date: Optional["DateTimeLikeObject"] = None, parse_day_first: bool = False ) -> datetime.date | None: """ Convert string date (yyyy-mm-dd) to datetime.date object. @@ -125,7 +123,6 @@ def getdate( frappe.throw( frappe._("{} is not a valid date string.").format(frappe.bold(string_date)), title=frappe._("Invalid Date"), - skip_msgprint=skip_msgprint, )