fix send_to_kindle
parent
935c7b4a4c
commit
da7d6ccfc5
|
@ -2929,11 +2929,20 @@ def send_to_kindle(request, work_id, javascript='0'):
|
||||||
work=safe_get_work(work_id)
|
work=safe_get_work(work_id)
|
||||||
context= {'work':work}
|
context= {'work':work}
|
||||||
acq = None
|
acq = None
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
try:
|
all_acqs=request.user.acqs.filter(work=work).order_by('-created')
|
||||||
acq = request.user.acqs.filter(work=work).order_by('-created')[0]
|
for an_acq in all_acqs:
|
||||||
except IndexError:
|
if not an_acq.expired:
|
||||||
acq = None
|
# skip for THANKS
|
||||||
|
if an_acq.license == THANKED:
|
||||||
|
acq = None
|
||||||
|
break
|
||||||
|
# prepare this acq for download
|
||||||
|
if not an_acq.watermarked or an_acq.watermarked.expired:
|
||||||
|
if not an_acq.on_reserve:
|
||||||
|
watermark_acq.delay(an_acq)
|
||||||
|
acq = an_acq
|
||||||
|
break
|
||||||
|
|
||||||
if acq:
|
if acq:
|
||||||
ebook_url = acq.get_mobi_url()
|
ebook_url = acq.get_mobi_url()
|
||||||
|
|
Loading…
Reference in New Issue