Skip to content
Snippets Groups Projects
Unverified Commit 9e4e9e58 authored by David Joy's avatar David Joy Committed by GitHub
Browse files

Merge pull request #140 from edx/stvn/bd03/fix-uuid

fix: Migrate the UUID backfill again
parents 36930ee4 8b17e4a6
No related branches found
No related tags found
No related merge requests found
......@@ -298,6 +298,12 @@ Please do not report security issues in public. Send security concerns via email
Changelog
=========
2.5.4 - 2021-02-XX
------------------
* Fix bug with `config_id` migration where an entry was created _during_
the migration and did _not_ receive a valid UUID value.
2.5.3 - 2021-01-26
------------------
......
from django.db import migrations, models
import uuid
def create_config_ids(apps, schema_editor):
LtiConfiguration = apps.get_model('lti_consumer', 'LtiConfiguration')
broken = LtiConfiguration.objects.filter(config_id__isnull=True)
for config in broken:
config.config_id = uuid.uuid4()
config.save()
class Migration(migrations.Migration):
dependencies = [
('lti_consumer', '0007_ltidlcontentitem'),
]
operations = [
migrations.AlterField(
model_name='lticonfiguration',
name='config_id',
field=models.UUIDField(default=uuid.uuid4, editable=True, unique=True),
),
migrations.RunPython(create_config_ids),
migrations.AlterField(
model_name='lticonfiguration',
name='config_id',
field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True),
),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment