getter fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 28 Aug 2012 14:55:42 +0000 (16:55 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 28 Aug 2012 14:55:42 +0000 (16:55 +0200)
migdal/helpers.py

index 11f8ddc..8a6513d 100644 (file)
@@ -20,7 +20,7 @@ class EntryType(namedtuple('EntryType', 'db slug commentable on_main')):
 def field_getter(name):
     @property
     def getter(self):
 def field_getter(name):
     @property
     def getter(self):
-        val = getattr(self, "%s_%s" % (name, get_language()))
+        val = getattr(self, "%s_%s" % (name, get_language()), None)
         if not val:
             val = getattr(self, "%s_%s" % (name, settings.LANGUAGE_CODE))
         return val
         if not val:
             val = getattr(self, "%s_%s" % (name, settings.LANGUAGE_CODE))
         return val