Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: updated migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Oct 19, 2023
1 parent 96a8653 commit 8d632aa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
from django.db import migrations, models
from oscar.core.loading import get_model

Option = get_model('catalogue', 'Option')


def create_entitlement_option(apps, schema_editor):
""" Create catalogue entitlement option. """
Option = apps.get_model('catalogue', 'Option')
Option.skip_history_when_saving = True
course_entitlement_option = Option()
course_entitlement_option.name = 'Course Entitlement'
course_entitlement_option.code = 'course_entitlement'
course_entitlement_option.type = 'Optional'
course_entitlement_option.save()


def remove_entitlement_option(apps, schema_editor):
""" Remove course entitlement option """
Option = apps.get_model('catalogue', 'Option')
Option.skip_history_when_saving = True
course_entitlement_option = Option.objects.get(code='course_entitlement')
course_entitlement_option.delete()
Expand Down

0 comments on commit 8d632aa

Please sign in to comment.