From 79fd39b9d377f92b8d526802fcd7bf3f4fb97637 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@bioforsk.no>
Date: Fri, 9 Jan 2015 11:21:12 +0100
Subject: [PATCH] More bugfix

---
 information/models.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/information/models.py b/information/models.py
index d1133864..8c779408 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
-- 
GitLab