mirror of
https://github.com/janeczku/calibre-web
synced 2024-10-31 15:16:20 +00:00
Fix for #1199 (missing referrer)
This commit is contained in:
parent
b152d3e06d
commit
ed0bdbf31d
@ -179,7 +179,10 @@ def remove_from_shelf(shelf_id, book_id):
|
||||
|
||||
if not xhr:
|
||||
flash(_(u"Book has been removed from shelf: %(sname)s", sname=shelf.name), category="success")
|
||||
return redirect(request.environ["HTTP_REFERER"])
|
||||
if "HTTP_REFERER" in request.environ:
|
||||
return redirect(request.environ["HTTP_REFERER"])
|
||||
else:
|
||||
return redirect(url_for('web.index'))
|
||||
return "", 204
|
||||
else:
|
||||
log.error("User %s not allowed to remove a book from %s", current_user, shelf)
|
||||
|
@ -1067,7 +1067,10 @@ def send_to_kindle(book_id, book_format, convert):
|
||||
flash(_(u"There was an error sending this book: %(res)s", res=result), category="error")
|
||||
else:
|
||||
flash(_(u"Please configure your kindle e-mail address first..."), category="error")
|
||||
return redirect(request.environ["HTTP_REFERER"])
|
||||
if "HTTP_REFERER" in request.environ:
|
||||
return redirect(request.environ["HTTP_REFERER"])
|
||||
else:
|
||||
return redirect(url_for('web.index'))
|
||||
|
||||
|
||||
# ################################### Login Logout ##################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user