Commit e20b7a9c by Clinton Blackburn

Added migration to convert program categories for XSeries

ECOM-5173
parent dfb61898
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def set_program_types(apps, schema_editor):
Program = apps.get_model('course_metadata', 'Program')
ProgramType = apps.get_model('course_metadata', 'ProgramType')
xseries_type = ProgramType.objects.get(name='XSeries')
Program.objects.filter(category__iexact='xseries').update(type=xseries_type)
class Migration(migrations.Migration):
dependencies = [
('edx_catalog_extensions', '0001_create_program_types'),
]
operations = [
migrations.RunPython(set_program_types, lambda *args: None)
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment