Skip to content

Commit

Permalink
refactor: register unit models in app setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi committed Nov 5, 2024
1 parent 23af217 commit d963f58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openedx_learning/apps/authoring/containers/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ContainersConfig(AppConfig):

def ready(self):
"""
Register Component and ComponentVersion.
Register ContainerEntity and ContainerEntityVersion.
"""
from ..publishing.api import register_content_models # pylint: disable=import-outside-toplevel
from .models import ContainerEntity, ContainerEntityVersion # pylint: disable=import-outside-toplevel
Expand Down
9 changes: 9 additions & 0 deletions openedx_learning/apps/authoring/units/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ class UnitsConfig(AppConfig):
verbose_name = "Learning Core > Authoring > Units"
default_auto_field = "django.db.models.BigAutoField"
label = "oel_units"

def ready(self):
"""
Register Unit and UnitVersion.
"""
from ..publishing.api import register_content_models # pylint: disable=import-outside-toplevel
from .models import Unit, UnitVersion # pylint: disable=import-outside-toplevel

register_content_models(Unit, UnitVersion)

0 comments on commit d963f58

Please sign in to comment.