Closed jhoobergs closed 1 year ago
Following migration seems to fix it for me:
# Generated by Django 3.2.16 on 2022-11-30 08:58
from django.db import migrations
from numbas_lti.models import Resource
class Migration(migrations.Migration):
dependencies = [
('numbas_lti', '0077_merge_0075_auto_20221018_1102_0076_resource_subject'),
]
def fix_require_lockdown_app(apps, schema_editor):
for resource in Resource.objects.all():
if resource.require_lockdown_app == "0":
resource.require_lockdown_app = ""
resource.save()
elif resource.require_lockdown_app == "1":
resource.require_lockdown_app = "numbas"
resource.save()
operations = [
migrations.RunPython(fix_require_lockdown_app),
]
(the dependency should be different)
Thanks for spotting this. I hadn't got round to testing the migration with a new instance yet. I've squashed the migrations, so anyone running this on existing databases from now on will get the correct values in that field.
require_lockdown_app
field seems to be faulty at https://github.com/numbas/numbas-lti-provider/blob/master/numbas_lti/migrations/0075_auto_20221018_1102.py#L34require_lockdown_app
fields with value "0" (the boolean seems to be converted to a string)