Skip to content

Commit

Permalink
chore: update microbachelors seat types (#4132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali-D-Akbar authored Oct 3, 2023
1 parent 5ffbddc commit 0dd3c57
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Migration to remove audit seat type from micro_bachelors program type.
"""
from django.db import migrations


def update_program_type(apps, schema_editor): # pylint: disable=unused-argument
ProgramType = apps.get_model('course_metadata', 'ProgramType')
SeatType = apps.get_model('course_metadata', 'SeatType')

micro_bachelors = ProgramType.objects.get(slug='microbachelors')
verified_seat_type = SeatType.objects.get(slug='verified')

# Set the applicable seat types for 'MicroBachelors' to only 'verified'
micro_bachelors.applicable_seat_types.set([verified_seat_type])


class Migration(migrations.Migration):

dependencies = [
('course_metadata', '0335_migrateprogramslugconfiguration'),
]

operations = [
migrations.RunPython(update_program_type, migrations.RunPython.noop),
]

0 comments on commit 0dd3c57

Please sign in to comment.