try/except remove poster

This commit is contained in:
j 2011-10-25 10:51:30 +02:00
parent af340843d8
commit d023219359

View file

@ -893,9 +893,9 @@ class Item(models.Model):
def delete_poster(self): def delete_poster(self):
if self.poster: if self.poster:
path = self.poster.path path = self.poster.path
if os.path.exists(path): try:
self.poster.delete() self.poster.delete()
else: except:
self.poster.name = None self.poster.name = None
else: else:
poster= self.path('poster.jpg') poster= self.path('poster.jpg')