From d4271e05253afc72c0c265463f11bbab15a660ad Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Tue, 15 Jun 2021 12:37:23 +0000 Subject: [PATCH] Skip populate_volunteers forward migration if nomcom2021 is not in the database. Fixes #3306. Commit ready for merge. - Legacy-Id: 19132 --- ietf/nomcom/migrations/0012_populate_volunteers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/nomcom/migrations/0012_populate_volunteers.py b/ietf/nomcom/migrations/0012_populate_volunteers.py index 223afa411..4da1bbaf0 100644 --- a/ietf/nomcom/migrations/0012_populate_volunteers.py +++ b/ietf/nomcom/migrations/0012_populate_volunteers.py @@ -5,7 +5,9 @@ from django.db import migrations def forward(apps, schema_editor): NomCom = apps.get_model('nomcom','NomCom') - nc = NomCom.objects.get(group__acronym='nomcom2021') + nc = NomCom.objects.filter(group__acronym='nomcom2021').first() + if nc is None: + return # nothing to do if the NomCom in question does not exist nc.is_accepting_volunteers = True nc.save()