forked from 0x2620/pandora
fix items without sort
This commit is contained in:
parent
3e46dc78cb
commit
246413027c
1 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue