Skip to content

Commit

Permalink
Also reset the exercise api cache when deleting images
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Dec 30, 2024
1 parent 49982a5 commit 25980fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions wger/exercises/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ def delete(self, *args, **kwargs):
"""
Reset all cached infos
"""
reset_exercise_api_cache(self.exercise_base.uuid)

super().delete(*args, **kwargs)

# Make sure there is always a main image
Expand Down
2 changes: 1 addition & 1 deletion wger/utils/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def reset_workout_canonical_form(workout_id):


def reset_exercise_api_cache(uuid: str):
cache.delete(cache_mapper.get_exercise_api_key(uuid))
cache.delete(CacheKeyMapper.get_exercise_api_key(uuid))


def reset_workout_log(user_pk, year, month, day=None):
Expand Down

0 comments on commit 25980fc

Please sign in to comment.