From 65496fea4942ce3a1100ec76696686bd10589b70 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 30 Jan 2022 10:26:28 -0800 Subject: [PATCH] Fixes black regression --- bookwyrm/templatetags/shelf_tags.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/bookwyrm/templatetags/shelf_tags.py b/bookwyrm/templatetags/shelf_tags.py index 7aef638f..6c4f59c3 100644 --- a/bookwyrm/templatetags/shelf_tags.py +++ b/bookwyrm/templatetags/shelf_tags.py @@ -36,22 +36,19 @@ def get_next_shelf(current_shelf): def active_shelf(context, book): """check what shelf a user has a book on, if any""" user = context["request"].user - return ( - cache.get_or_set( - f"active_shelf-{user.id}-{book.id}", - lambda u, b: ( - models.ShelfBook.objects.filter( - shelf__user=u, - book__parent_work__editions=b, - ).first() - or False - ), - user, - book, - timeout=15552000, - ) - or {"book": book} - ) + return cache.get_or_set( + f"active_shelf-{user.id}-{book.id}", + lambda u, b: ( + models.ShelfBook.objects.filter( + shelf__user=u, + book__parent_work__editions=b, + ).first() + or False + ), + user, + book, + timeout=15552000, + ) or {"book": book} @register.simple_tag(takes_context=False)