From 61616293c88eeb5ca42add852a328408da4e2ae5 Mon Sep 17 00:00:00 2001 From: Sanjay B Date: Mon, 23 Sep 2013 20:51:11 +0530 Subject: [PATCH] main image weirdness --- itf/app/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/itf/app/models.py b/itf/app/models.py index a221fc7..a23b87e 100755 --- a/itf/app/models.py +++ b/itf/app/models.py @@ -253,17 +253,15 @@ class ItfModel(models.Model): Get the main image thumbnail for this object - checks if object has either a field or custom method called 'main_image', then checks for default_images on the ModelExtra for this model. ''' def get_main_image(self, size="142x150"): - + imgfield = None if hasattr(self, 'main_image'): main_image_getter = self.main_image if type(main_image_getter).__name__ == 'instancemethod': imgfield = main_image_getter() else: imgfield = main_image_getter - else: - imgfield = self.get_modelextra().default_image #FIXME!! - if imgfield is None or imgfield.name == '' and self.get_modelextra(): + if imgfield is None or imgfield.name == '': imgfield = self.get_modelextra().default_image if imgfield: