This commit is contained in:
Joachim 2023-01-01 19:45:12 +01:00
parent f266c71da9
commit bc19d7c658
3 changed files with 5 additions and 5 deletions

View file

@ -43,7 +43,7 @@ class ReadingStatus(View):
@transaction.atomic
def post(self, request, status, book_id):
"""Change the state of a book by shelving it and adding reading dates"""
next_step = request.META.get('HTTP_REFERER')
next_step = request.META.get("HTTP_REFERER")
next_step = validate_url_domain(next_step, "/")
identifier = {
"want": models.Shelf.TO_READ,

View file

@ -36,7 +36,7 @@ def delete_shelf(request, shelf_id):
@transaction.atomic
def shelve(request):
"""put a book on a user's shelf"""
next_step = request.META.get('HTTP_REFERER')
next_step = request.META.get("HTTP_REFERER")
next_step = validate_url_domain(next_step, "/")
book = get_object_or_404(models.Edition, id=request.POST.get("book"))
desired_shelf = get_object_or_404(
@ -98,7 +98,7 @@ def shelve(request):
@require_POST
def unshelve(request, book_id=False):
"""remove a book from a user's shelf"""
next_step = request.META.get('HTTP_REFERER')
next_step = request.META.get("HTTP_REFERER")
next_step = validate_url_domain(next_step, "/")
identity = book_id if book_id else request.POST.get("book")
book = get_object_or_404(models.Edition, id=identity)

View file

@ -59,7 +59,7 @@ class CreateStatus(View):
# pylint: disable=too-many-branches
def post(self, request, status_type, existing_status_id=None):
"""create status of whatever type"""
next_step = request.META.get('HTTP_REFERER')
next_step = request.META.get("HTTP_REFERER")
next_step = validate_url_domain(next_step, "/")
created = not existing_status_id
existing_status = None
@ -170,7 +170,7 @@ def update_progress(request, book_id): # pylint: disable=unused-argument
def edit_readthrough(request):
"""can't use the form because the dates are too finnicky"""
# TODO: remove this, it duplicates the code in the ReadThrough view
next_step = request.META.get('HTTP_REFERER')
next_step = request.META.get("HTTP_REFERER")
next_step = validate_url_domain(next_step, "/")
readthrough = get_object_or_404(models.ReadThrough, id=request.POST.get("id"))