ignore empty items
This commit is contained in:
parent
de96448137
commit
ecd88fe8a2
1 changed files with 2 additions and 0 deletions
|
@ -26,6 +26,8 @@ class Command(BaseCommand):
|
|||
for e in item.models.Item.objects.filter(data__title=i.data['title']):
|
||||
if 'type' not in e.data:
|
||||
print("ignoring invalid video", e)
|
||||
if not e.files.filter(selected=True).exists():
|
||||
continue
|
||||
source = e.files.filter(selected=True)[0].data.path
|
||||
ext = os.path.splitext(source)[1]
|
||||
type_ = e.data['type'][0].lower()
|
||||
|
|
Loading…
Reference in a new issue