summaryrefslogtreecommitdiff
path: root/app/src/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/views.py')
-rw-r--r--app/src/views.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/views.py b/app/src/views.py
index 95ddafa..203a021 100644
--- a/app/src/views.py
+++ b/app/src/views.py
@@ -27,9 +27,13 @@ class BookDetailView(DetailView):
# Call the base implementation first to get a context
context = super(BookDetailView, self).get_context_data(**kwargs)
book = self.get_object()
+ if book.price_sale < book.price:
+ price = book.price_sale
+ else:
+ price = book.price
paypal_dict = {
"business": settings.PAYPAL_RECEIVER_EMAIL,
- "amount": book.price,
+ "amount": price,
"item_name": book.title,
"invoice": "unique-invoice-id",
"notify_url": "https://www.example.com" + reverse('src:paypal-ipn'),