Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Use correct cache key

Roland Geiderfa1b7124fcc8
diff --git a/wger/nutrition/api/views.py b/wger/nutrition/api/views.py
index 473d36c30..eefb30ead 100644
--- a/wger/nutrition/api/views.py
+++ b/wger/nutrition/api/views.py
@@ -78,7 +78,6 @@ from wger.utils.db import is_postgres_db
from wger.utils.language import load_language
from wger.utils.viewsets import WgerOwnerObjectModelViewSet
-
logger = logging.getLogger(__name__)
@@ -92,7 +91,7 @@ class IngredientViewSet(viewsets.ReadOnlyModelViewSet):
ordering_fields = '__all__'
filterset_class = IngredientFilterSet
- @method_decorator(cache_page(settings.WGER_SETTINGS['EXERCISE_CACHE_TTL']))
+ @method_decorator(cache_page(settings.WGER_SETTINGS['INGREDIENT_CACHE_TTL']))
def list(self, request, *args, **kwargs):
return super().list(request, *args, **kwargs)
@@ -267,7 +266,7 @@ class ImageViewSet(viewsets.ReadOnlyModelViewSet):
ordering_fields = '__all__'
filterset_fields = ('uuid', 'ingredient_id', 'ingredient__uuid')
- @method_decorator(cache_page(settings.WGER_SETTINGS['EXERCISE_CACHE_TTL']))
+ @method_decorator(cache_page(settings.WGER_SETTINGS['INGREDIENT_CACHE_TTL']))
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)