From df7ee42254696c98b8ed07810c2aaaacaa50fc8c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 12 Dec 2018 19:36:43 +0000 Subject: [PATCH] Allow to bypass m18n if a raw message is given --- moulinette/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moulinette/core.py b/moulinette/core.py index 1bdd602a..894c85b8 100644 --- a/moulinette/core.py +++ b/moulinette/core.py @@ -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