Added a progress bar to the submission checker json field upgrade migration.

- Legacy-Id: 14276
This commit is contained in:
Henrik Levkowetz 2017-11-02 14:48:28 +00:00
parent 6edcd1b407
commit 370a0e3d94

View file

@ -2,6 +2,8 @@
# Generated by Django 1.10.8 on 2017-10-27 06:34
from __future__ import unicode_literals
from tqdm import tqdm
from django.db import migrations
# convert the SubmissionCheck.items to consistently be a dict, with the
@ -13,11 +15,11 @@ from django.db import migrations
# 'draft': <draftname>;
# 'modules': { <extracted module info> },
# }
tqdm.monitor_interval = 0 # workaround for spurious error in tqdm's monitoring thread
def forwards(apps, schema_editor):
SubmissionCheck = apps.get_model('submit', 'SubmissionCheck')
for check in SubmissionCheck.objects.all().order_by('id'):
for check in tqdm(SubmissionCheck.objects.all()):
# deal with these cases:
# * empty dictionary
# * empty list