migrations: don't try migration to parent cells on unknown templates (#11322)

This commit is contained in:
Frédéric Péters 2017-02-04 10:31:18 +01:00
parent 39ca061eee
commit 30c9e15c58
1 changed files with 2 additions and 0 deletions

View File

@ -10,6 +10,8 @@ def create_parent_content_cells(apps, schema_editor):
ParentContentCell = apps.get_model('data', 'ParentContentCell')
for page in Page.objects.all():
combo_template = settings.COMBO_PUBLIC_TEMPLATES.get(page.template_name)
if not combo_template:
continue
for placeholder_key, placeholder_value in combo_template['placeholders'].items():
if not placeholder_value.get('acquired'):
continue