handle stories with 0 images

This commit is contained in:
Sanj 2011-10-06 17:03:38 +05:30
parent 543c1fff2c
commit e67df25d70

View File

@ -47,7 +47,11 @@ class BestPractice(ItfModel):
} }
def main_image(self): def main_image(self):
return self.get_images()[0] imgs = self.get_images()
if len(imgs) > 0:
return imgs[0]
else:
return None
def list_dict(self): def list_dict(self):
return { return {