mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
Fix KeyError on first run when no language is set
This commit is contained in:
parent
aeaa6ab800
commit
027dd528db
@ -59,8 +59,9 @@ def get_language(request):
|
|||||||
# taking care of setting language on login, and adapting kvstore when
|
# taking care of setting language on login, and adapting kvstore when
|
||||||
# renaming/deleting users
|
# renaming/deleting users
|
||||||
|
|
||||||
# The session contains more accurate information than request.LANGUAGE_CODE
|
# The information from the session is more accurate but not always present
|
||||||
return request.session[translation.LANGUAGE_SESSION_KEY]
|
return request.session.get(translation.LANGUAGE_SESSION_KEY,
|
||||||
|
request.LANGUAGE_CODE)
|
||||||
|
|
||||||
|
|
||||||
class TrimmedCharField(forms.CharField):
|
class TrimmedCharField(forms.CharField):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user