From ecf6c60ce9eb3a07f3b0dd1403f7c69db135fcc9 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 7 Dec 2020 14:15:17 +0100 Subject: [PATCH] Fixes for payment form on book page. --- src/catalogue/templates/catalogue/book_wide.html | 5 +++-- src/catalogue/views.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/catalogue/templates/catalogue/book_wide.html b/src/catalogue/templates/catalogue/book_wide.html index 84eb9ddcb..d7c2a09d5 100644 --- a/src/catalogue/templates/catalogue/book_wide.html +++ b/src/catalogue/templates/catalogue/book_wide.html @@ -25,8 +25,6 @@

{% chunk "book-preview-warn" %}

- - {% include "club/payment_info.html" %} {% endblock %} @@ -54,8 +52,11 @@ {% chunk 'club_form_bottom' %} {% endwith %} + + {% include "club/payment_info.html" %} {% endif %} + {% endblock %} diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 9a36b7305..398c61cc4 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -18,7 +18,7 @@ from django.views.decorators.cache import never_cache from ajaxable.utils import AjaxableFormView from club.forms import ScheduleForm -from club.models import Membership +from club.models import Club, Membership from annoy.models import DynamicTextInsert from pdcounter import views as pdcounter_views from picture.models import Picture, PictureArea @@ -291,6 +291,7 @@ def book_detail(request, slug): 'book_children': book.children.all().order_by('parent_number', 'sort_key'), 'active_menu_item': 'books', 'club_form': ScheduleForm() if book.preview else None, + 'club': Club.objects.first() if book.preview else None, }) -- 2.20.1