fix(event): clear message after handling exception

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-04-01 21:45:31 +05:30
parent bf931598a2
commit da563ef0e4
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -397,6 +397,9 @@ def get_events(start, end, user=None, for_reminder=False, filters=None) -> list[
try:
getdate(date)
except Exception:
# Don't show any message to the user
frappe.clear_last_message()
date = date.split("-")
date = date[0] + "-" + str(cint(date[1]) - 1) + "-" + date[2]
@ -425,6 +428,9 @@ def get_events(start, end, user=None, for_reminder=False, filters=None) -> list[
try:
getdate(date)
except Exception:
# Don't show any message to the user
frappe.clear_last_message()
date = date.split("-")
date = date[0] + "-" + str(cint(date[1]) - 1) + "-" + date[2]
@ -453,6 +459,9 @@ def get_events(start, end, user=None, for_reminder=False, filters=None) -> list[
try:
getdate(date)
except Exception:
# Don't show any message to the user
frappe.clear_last_message()
date = date.split("-")
date = date[0] + "-" + str(cint(date[1]) - 1) + "-" + date[2]