From fc9728e7bec67795f79f940cebd3b3c2374ab799 Mon Sep 17 00:00:00 2001 From: Paul Upendo Date: Fri, 28 Apr 2017 13:03:08 +0300 Subject: [PATCH] Initial commit --- wger/utils/language.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wger/utils/language.py b/wger/utils/language.py index 5a1f13e..f8975d5 100644 --- a/wger/utils/language.py +++ b/wger/utils/language.py @@ -49,7 +49,9 @@ def load_language(language_code=None): return language try: - language = Language.objects.get(short_name=used_language) + language, is_created = Language.objects.get_or_create(short_name=used_language) + # language = Language.objects.get(short_name=used_language) + except ObjectDoesNotExist: # No luck, load english as our fall-back language language = Language.objects.get(short_name="en")