[IMP] introduce a new kind of exception: RedirectWarning (warning with an additional redirection button)

bzr revid: abo@openerp.com-20130131181520-q5ol3ngsn93u7hg5
This commit is contained in:
Antonin Bourguignon 2013-01-31 19:15:20 +01:00
parent 2459399cac
commit a4af860968
1 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,19 @@ treated as a 'Server error'.
class Warning(Exception):
pass
class RedirectWarning(Exception):
""" Warning with a possibility to redirect the user instead of simply
discarding the warning message.
"""
def __init__(self, msg, action_id, button_text):
"""
:param int action_id: id of the action required to perform the
redirection
:param string button_text: text to put on the button which will trigger
the redirection
"""
super(RedirectWarning, self).__init__(msg, action_id, button_text)
class AccessDenied(Exception):
""" Login/password error. No message, no traceback. """
def __init__(self):