File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import logging
66from typing import overload
77
8- from django .conf import settings
98from opaque_keys .edx .keys import CourseKey
10- from organizations .api import ensure_organization
9+ from organizations .api import ensure_organization # type: ignore[import]
1110from organizations .api import exceptions as org_exceptions
1211
1312from .models import CatalogCourse , CourseRun
Original file line number Diff line number Diff line change @@ -136,15 +136,15 @@ def language_short(self) -> str:
136136 return self .language [:2 ] # Strip locale
137137
138138 @language_short .setter
139- def language_short (self , legacy_code : str ) -> str :
139+ def language_short (self , legacy_code : str ) -> None :
140140 """
141141 Set the language code used by this catalog course, without locale.
142142 This is always a two-digit code, except for Mandarin and Cantonese.
143143 (This should be a value from settings.ALL_LANGUAGES, and should match
144144 the CourseOverview.language field.)
145145 """
146146 if hasattr (settings , "ALL_LANGUAGES" ):
147- assert legacy_code in [code for (code , _name ) in settings .ALL_LANGUAGES ]
147+ assert legacy_code in [code for (code , _name ) in settings .ALL_LANGUAGES ] # type: ignore
148148 if legacy_code == "zh_HANS" : # Mandarin / Simplified
149149 self .language = "zh-cn" # Chinese (Mainland China)
150150 elif legacy_code == "zh_HANT" : # Cantonese / Traditional
Original file line number Diff line number Diff line change 66See the `openedx_catalog.api` docstring for much more details.
77"""
88
9+ # pylint: disable=unused-import
910from .models import CatalogCourse , CourseRun
Original file line number Diff line number Diff line change 1414from openedx_catalog import api
1515from openedx_catalog .models_api import CatalogCourse , CourseRun
1616
17-
1817pytestmark = pytest .mark .django_db
1918
2019
You can’t perform that action at this time.
0 commit comments