Revert "Merge pull request #25755 from akhilnarang/optional-skip-msgprint"

This reverts commit f8121b99df, reversing
changes made to 14e2d95947.
This commit is contained in:
Akhil Narang 2024-04-01 21:42:12 +05:30
parent 2bf0ab079a
commit bf931598a2
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F
3 changed files with 3 additions and 11 deletions

View file

@ -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,
)

View file

@ -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]

View file

@ -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,
)