@@ -0,0 +1,1019 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.18 on 2019-04-29 15:44%0Afrom __future__ import unicode_literals%0A%0Aimport logging%0Afrom django.db import migrations%0A%0A%0Adef update_backend(apps, schema_editor):%0A    from django.conf import settings%0A    log = logging.getLogger(__name__)%0A    ProctoredExam = apps.get_model('edx_proctoring', 'ProctoredExam')%0A    default_backend = settings.PROCTORING_BACKENDS.get('DEFAULT', None)%0A    if default_backend:%0A        for exam in ProctoredExam.objects.filter(backend__isnull=True):%0A            exam.backend = default_backend%0A            exam.save()%0A            log.info(%22updated exam %25d with backend %25d%22, exam.id, default_backend)%0A    else:%0A        log.warning(%22settings.PROCTORING_BACKENDS%5B'DEFAULT'%5D is not set. Unable to do migration.%22)%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('edx_proctoring', '0009_proctoredexamreviewpolicy_remove_rules'),%0A    %5D%0A%0A    operations = %5B%0A        migrations.RunPython(update_backend, migrations.RunPython.noop)%0A    %5D%0A

Add migration for missing backend data