diff --git a/information/models.py b/information/models.py index d1133864ee5b295e36b15b6adc82679099793289..8c77940854a4c6006f95af61591760367f9cb648 100644 --- a/information/models.py +++ b/information/models.py @@ -21,7 +21,7 @@ class InformationLocale(models.Model): @staticmethod def get_information_locale_with_fallback(information_id, language_code=translation.get_language()): if information_id == None: - return "" + return None # Try with user's preferred locale first try: return InformationLocale.objects.get( @@ -50,4 +50,8 @@ class InformationLocale(models.Model): @staticmethod def get_heading_with_fallback(information_id, language_code=translation.get_language()): - return InformationLocale.get_information_locale_with_fallback(information_id, language_code).headline \ No newline at end of file + information_locale = InformationLocale.get_information_locale_with_fallback(information_id, language_code) + if information_locale == None: + return "" + else: + return InformationLocale.get_information_locale_with_fallback(information_id, language_code).headline \ No newline at end of file