From 1765bd6b133818806c96a639d21d2efffba589c6 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 4 Jun 2015 10:32:45 +0200 Subject: [PATCH] fix traceback when language in user profile is None, fixes #206 --- nsupdate/utils/mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsupdate/utils/mail.py b/nsupdate/utils/mail.py index 90d06dc..a0aa765 100644 --- a/nsupdate/utils/mail.py +++ b/nsupdate/utils/mail.py @@ -17,7 +17,7 @@ def translate_for_user(user, *msgs): :param msgs: list of lazy translatable strings :return: list of translated strings """ - lang = user.profile.language + lang = user.profile.language or 'en' saved_lang = translation.get_language() try: translation.activate(lang)