Fixes black regression

This commit is contained in:
Mouse Reeve 2022-01-30 10:26:28 -08:00
parent ae0e67f076
commit 65496fea49
1 changed files with 13 additions and 16 deletions

View File

@ -36,8 +36,7 @@ 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(
return cache.get_or_set(
f"active_shelf-{user.id}-{book.id}",
lambda u, b: (
models.ShelfBook.objects.filter(
@ -49,9 +48,7 @@ def active_shelf(context, book):
user,
book,
timeout=15552000,
)
or {"book": book}
)
) or {"book": book}
@register.simple_tag(takes_context=False)