From e8c830750a92c70f1bfca02caeceebc889d990d3 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 9 Jan 2022 13:00:02 -0800 Subject: [PATCH] No cache for suggested books --- bookwyrm/templates/landing/landing.html | 3 ++- bookwyrm/views/reading.py | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/landing/landing.html b/bookwyrm/templates/landing/landing.html index 759e8c61..985a7c6d 100644 --- a/bookwyrm/templates/landing/landing.html +++ b/bookwyrm/templates/landing/landing.html @@ -7,7 +7,8 @@

{% trans "Recent Books" %}

-{% cache 60 * 60 %} +{% get_current_language as LANGUAGE_CODE %} +{% cache 60 * 60 LANGUAGE_CODE %}
diff --git a/bookwyrm/views/reading.py b/bookwyrm/views/reading.py index 77e527f3..fd12dc0f 100644 --- a/bookwyrm/views/reading.py +++ b/bookwyrm/views/reading.py @@ -46,11 +46,8 @@ class ReadingStatus(View): return HttpResponseBadRequest() # invalidate related caches - cache.delete_many( - [ - f"suggested_books-{request.user.id}", - f"active_shelf-{request.user.id}-{book_id}", - ] + cache.delete( + f"active_shelf-{request.user.id}-{book_id}", ) desired_shelf = get_object_or_404(