From 12cf531e7b81d9c2517b338d40bdac9886ed1fcb Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 22 May 2014 22:35:29 -0400 Subject: [PATCH 1/2] purchased copies need full url --- frontend/templates/download.html | 4 ++-- frontend/views.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/templates/download.html b/frontend/templates/download.html index dbea059b..09c209fc 100644 --- a/frontend/templates/download.html +++ b/frontend/templates/download.html @@ -169,11 +169,11 @@ $j(document).ready(function() {
epub EPUB (for iBooks, Nook, Kobo) - +

mobi MOBI (for Kindle) - +
{% endifequal %} {% endif %} diff --git a/frontend/views.py b/frontend/views.py index d5cb1359..582e0f79 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -2712,7 +2712,7 @@ class DownloadView(PurchaseView): unglued_ebooks = work.ebooks().filter(edition__unglued=True) other_ebooks = work.ebooks().filter(edition__unglued=False) - + xfer_url = None acq=None formats = {} # a dict of format name and url for ebook in work.ebooks().all(): @@ -2734,6 +2734,7 @@ class DownloadView(PurchaseView): formats['epub']= reverse('download_acq', kwargs={'nonce':acq.nonce, 'format':'epub'}) formats['mobi']= reverse('download_acq', kwargs={'nonce':acq.nonce, 'format':'mobi'}) xfer_url = settings.BASE_URL_SECURE + formats['epub'] + kindle_url = settings.BASE_URL_SECURE + formats['mobi'] can_kindle = True break @@ -2769,6 +2770,7 @@ class DownloadView(PurchaseView): 'other_ebooks': other_ebooks, 'formats': formats, 'xfer_url': xfer_url, + 'kindle_url': kindle_url, 'dropbox_key': settings.DROPBOX_KEY, 'can_kindle': can_kindle, 'base_url': settings.BASE_URL_SECURE, From c4975027663c847d6512154030900099b7412d87 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 22 May 2014 22:38:42 -0400 Subject: [PATCH 2/2] this time I remembered to check the test --- frontend/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/views.py b/frontend/views.py index 582e0f79..b0a36472 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -2712,7 +2712,7 @@ class DownloadView(PurchaseView): unglued_ebooks = work.ebooks().filter(edition__unglued=True) other_ebooks = work.ebooks().filter(edition__unglued=False) - xfer_url = None + xfer_url = kindle_url = None acq=None formats = {} # a dict of format name and url for ebook in work.ebooks().all():