dont die for 0 images on meetings

This commit is contained in:
Sanj 2011-12-15 23:46:49 +05:30
parent 55fc0e5227
commit 8631ed7f64

View File

@ -50,8 +50,11 @@ class Meeting(ItfModel):
return self.preview_dict()
def main_image(self):
img = Image.objects.filter(meeting=self)[0]
return img.file
if Image.objects.filter(meeting=self).count() > 0:
img = Image.objects.filter(meeting=self)[0]
return img.file
else:
return None
def info_dict(self):
meeting_data = {}