From 202696f913e8cd4b2b347cb2e9b958e1d0f65866 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 28 Feb 2022 10:03:24 -0800 Subject: [PATCH] Don't show lists a book is already on in add form --- bookwyrm/templates/book/book.html | 4 ++-- bookwyrm/views/books/books.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 60e3d4fd8..0e2fd5d39 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -352,7 +352,7 @@ {% endfor %} - {% if request.user.list_set.exists %} + {% if list_options.exists %}
{% csrf_token %} @@ -361,7 +361,7 @@
diff --git a/bookwyrm/views/books/books.py b/bookwyrm/views/books/books.py index e04230bac..ad7ee9436 100644 --- a/bookwyrm/views/books/books.py +++ b/bookwyrm/views/books/books.py @@ -83,6 +83,7 @@ class Book(View): } if request.user.is_authenticated: + data["list_options"] = request.user.list_set.exclude(id__in=data["lists"]) data["file_link_form"] = forms.FileLinkForm() readthroughs = models.ReadThrough.objects.filter( user=request.user,