ignore broken poster frames

This commit is contained in:
j 2019-11-02 17:14:35 +01:00
parent 9881bfa62a
commit 05aa23166e

View file

@ -271,12 +271,13 @@ class List(models.Model):
self.save() self.save()
for i in self.poster_frames: for i in self.poster_frames:
from item.models import Item from item.models import Item
qs = Item.objects.filter(public_id=i['item']) if 'item' in i:
if qs.count() > 0: qs = Item.objects.filter(public_id=i['item'])
if i.get('position'): if qs.count() > 0:
frame = qs[0].frame(i['position']) if i.get('position'):
if frame: frame = qs[0].frame(i['position'])
frames.append(frame) if frame:
frames.append(frame)
self.icon.name = self.path('icon.jpg') self.icon.name = self.path('icon.jpg')
icon = self.icon.path icon = self.icon.path
if frames: if frames: