Skip to content

Commit

Permalink
Add missing user id to cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Oct 31, 2023
1 parent aec6a68 commit 50db9e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates_bw/accounts/account_latest_packs_section.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load display_pack %}
{% load cache %}
{% cache 43200 bw_user_profile_latest_packs_section is_authenticated %}
{% cache 43200 bw_user_profile_latest_packs_section user.id is_authenticated %}
{% with user.profile.get_latest_packs_for_profile_page as latest_packs %}
{% if latest_packs %}
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions utils/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def invalidate_user_template_caches(user_id):
invalidate_template_cache('bw_user_profile_followers_count', user_id)
invalidate_template_cache('bw_user_profile_following_count', user_id)
invalidate_template_cache('bw_user_profile_following_tags_count', user_id)
invalidate_template_cache('bw_user_profile_latest_packs_section', True)
invalidate_template_cache('bw_user_profile_latest_packs_section', False)
invalidate_template_cache('bw_user_profile_latest_packs_section', user_id, True)
invalidate_template_cache('bw_user_profile_latest_packs_section', user_id, False)
cache.delete(settings.USER_STATS_CACHE_KEY.format(user_id))


Expand Down

0 comments on commit 50db9e3

Please sign in to comment.