Skip to content

Commit

Permalink
Merge pull request #190 from openedx/modify-queryset
Browse files Browse the repository at this point in the history
feat: modify queryset from prefetch to select related
  • Loading branch information
AfaqShuaib09 authored Jan 9, 2024
2 parents 410940a + 048e8b8 commit df8c5cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Change Log
Unreleased

[1.46.1] - 2024-01-05
---------------------
* feat: Modify prefetch related to select related for whitelisted product skills.

[1.46.0] - 2023-10-23
---------------------
* feat: Removed direct usages of JobSkills and IndustryJobSkills objects in favour of whitelisted or blacklisted query sets.
Expand Down
2 changes: 1 addition & 1 deletion taxonomy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# 2. MINOR version when you add functionality in a backwards compatible manner, and
# 3. PATCH version when you make backwards compatible bug fixes.
# More details can be found at https://semver.org/
__version__ = '1.46.0'
__version__ = '1.46.1'

default_app_config = 'taxonomy.apps.TaxonomyConfig' # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion taxonomy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_whitelisted_serialized_skills(key_or_uuid, product_type=ProductTypes.Cou
return cached_response.value

whitelisted_product_skills = get_whitelisted_product_skills(key_or_uuid, product_type)
product_skills = whitelisted_product_skills.prefetch_related('skill__category', 'skill__subcategory')
product_skills = whitelisted_product_skills.select_related('skill__category', 'skill__subcategory')
skills = [product_skill.skill for product_skill in product_skills]
skills_data = SkillSerializer(skills, many=True).data
TieredCache.set_all_tiers(
Expand Down

0 comments on commit df8c5cd

Please sign in to comment.