Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: modify queryset from prefetch to select related #190

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading