fix traceback when language in user profile is None, fixes #206

This commit is contained in:
Thomas Waldmann 2015-06-04 10:32:45 +02:00
parent 2922cbcd53
commit 1765bd6b13

View File

@ -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)