fix traceback when language in user profile is None, fixes #206
This commit is contained in:
parent
2922cbcd53
commit
1765bd6b13
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user