mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Allow to bypass m18n if a raw message is given
This commit is contained in:
parent
a58d4dbb87
commit
df7ee42254
1 changed files with 5 additions and 2 deletions
|
@ -412,8 +412,11 @@ def clean_session(session_id, profiles=[]):
|
|||
|
||||
class MoulinetteError(StandardError):
|
||||
"""Moulinette base exception"""
|
||||
def __init__(self, key, *args, **kwargs):
|
||||
msg = moulinette.m18n.g(key, *args, **kwargs)
|
||||
def __init__(self, key, __raw_msg__=False, *args, **kwargs):
|
||||
if __raw_msg__:
|
||||
msg = key
|
||||
else:
|
||||
msg = moulinette.m18n.g(key, *args, **kwargs)
|
||||
super(MoulinetteError, self).__init__(msg)
|
||||
self.strerror = msg
|
||||
|
||||
|
|
Loading…
Reference in a new issue