fix items without sort

This commit is contained in:
j 2019-12-19 21:14:46 +02:00
parent 3e46dc78cb
commit 246413027c

View file

@ -107,6 +107,8 @@ class Command(BaseCommand):
print(sql) print(sql)
cursor.execute(sql) cursor.execute(sql)
transaction.commit() transaction.commit()
for i in models.Item.objects.filter(sort=None):
i.save()
if rebuild: if rebuild:
print("Updating sort values...") print("Updating sort values...")
ids = [i['id'] for i in models.Item.objects.all().values('id')] ids = [i['id'] for i in models.Item.objects.all().values('id')]
@ -115,3 +117,5 @@ class Command(BaseCommand):
if options['debug']: if options['debug']:
print(i) print(i)
i.update_sort() i.update_sort()
for i in models.Item.objects.filter(sort=None):
i.save()