Self hosted FLOSS fitness/workout, nutrition and weight tracker
Use specific does-not-exist exception
Roland Geider17ac0b05f3f4
diff --git a/wger/utils/language.py b/wger/utils/language.pyindex 982f154a9..95ea4f19b 100644--- a/wger/utils/language.py+++ b/wger/utils/language.py@@ -17,7 +17,6 @@ import logging# Djangofrom django.core.cache import cache-from django.core.exceptions import ObjectDoesNotExistfrom django.utils import translation# wger@@ -46,8 +45,7 @@ def load_language(language_code=None):try:language = Language.objects.get(short_name=used_language)- except ObjectDoesNotExist:- # No luck, load english as our fall-back language+ except Language.DoesNotExist:language = Language.objects.get(short_name=ENGLISH_SHORT_NAME)cache.set(cache_mapper.get_language_key(language.short_name), language)