Skip to content

Commit c35b092

Browse files
committed
add changes
1 parent 64d82eb commit c35b092

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

breathecode/registry/actions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,8 +1206,8 @@ def add_syllabus_translations(_json: dict):
12061206
"title": a.title,
12071207
}
12081208
# add translations technologies as well
1209-
_assetTechs = a.technologies.all()
1210-
for t in _assetTechs:
1209+
asset_techs = a.technologies.all()
1210+
for t in asset_techs:
12111211
# Use the slug as a unique key to avoid duplicates
12121212
if t.slug not in unique_technologies:
12131213
unique_technologies[t.slug] = {"slug": t.slug, "title": t.title}
@@ -1218,8 +1218,8 @@ def add_syllabus_translations(_json: dict):
12181218
"title": _asset.title,
12191219
}
12201220

1221-
_assetTechs = _asset.technologies.all()
1222-
for t in _assetTechs:
1221+
asset_techs = _asset.technologies.all()
1222+
for t in asset_techs:
12231223
# Use the slug as a unique key to avoid duplicates
12241224
if t.slug not in unique_technologies:
12251225
unique_technologies[t.slug] = {"slug": t.slug, "title": t.title}

breathecode/registry/tasks.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,18 @@
3838
test_asset,
3939
upload_image_to_bucket,
4040
)
41-
from .models import Asset, AssetImage, AssetContext
41+
from .models import Asset, AssetContext, AssetImage
4242

4343
logger = logging.getLogger(__name__)
4444

4545

46+
LANG_MAP = {
47+
"en": "english",
48+
"es": "spanish",
49+
"it": "italian",
50+
}
51+
52+
4653
def google_project_id():
4754
return os.getenv("GOOGLE_PROJECT_ID", "")
4855

@@ -611,11 +618,6 @@ def async_generate_quiz_config(assessment_id):
611618
@shared_task(priority=TaskPriority.CONTENT.value)
612619
def async_build_asset_context(asset_id):
613620
asset = Asset.objects.get(id=asset_id)
614-
LANG_MAP = {
615-
"en": "english",
616-
"es": "spanish",
617-
"it": "italian",
618-
}
619621

620622
lang = asset.lang or asset.category.lang
621623
lang_name = LANG_MAP.get(lang, lang)

staging/core/managers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import os
22
from typing import Optional
3+
34
from dotenv import dotenv_values
45

56

67
class EnvLoader:
7-
def __init_subclass__(self) -> None:
8-
self._load_flags()
8+
def __init_subclass__(cls) -> None:
9+
cls._load_flags()
910

1011
@classmethod
1112
def _load_flags(cls) -> None:

0 commit comments

Comments
 (0)