Skip to content

Commit

Permalink
feat: support primary_action for frappe.throw
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Feb 6, 2024
1 parent eb1b1b4 commit 40f1ae1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frappe/__init__.py
Expand Up @@ -659,11 +659,18 @@ def throw(
is_minimizable: bool = False,
wide: bool = False,
as_list: bool = False,
primary_action=None,
) -> None:
"""Throw execption and show message (`msgprint`).
:param msg: Message.
:param exc: Exception class. Default `frappe.ValidationError`"""
:param exc: Exception class. Default `frappe.ValidationError`
:param title: [optional] Message title. Default: "Message".
:param is_minimizable: [optional] Allow users to minimize the modal
: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.
"""
msgprint(
msg,
raise_exception=exc,
Expand All @@ -672,6 +679,7 @@ def throw(
is_minimizable=is_minimizable,
wide=wide,
as_list=as_list,
primary_action=primary_action,
)


Expand Down

0 comments on commit 40f1ae1

Please sign in to comment.