mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-09-22 03:20:03 +00:00
Black
This commit is contained in:
parent
f266c71da9
commit
bc19d7c658
3 changed files with 5 additions and 5 deletions
|
@ -43,7 +43,7 @@ class ReadingStatus(View):
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def post(self, request, status, book_id):
|
def post(self, request, status, book_id):
|
||||||
"""Change the state of a book by shelving it and adding reading dates"""
|
"""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, "/")
|
next_step = validate_url_domain(next_step, "/")
|
||||||
identifier = {
|
identifier = {
|
||||||
"want": models.Shelf.TO_READ,
|
"want": models.Shelf.TO_READ,
|
||||||
|
|
|
@ -36,7 +36,7 @@ def delete_shelf(request, shelf_id):
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def shelve(request):
|
def shelve(request):
|
||||||
"""put a book on a user's shelf"""
|
"""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, "/")
|
next_step = validate_url_domain(next_step, "/")
|
||||||
book = get_object_or_404(models.Edition, id=request.POST.get("book"))
|
book = get_object_or_404(models.Edition, id=request.POST.get("book"))
|
||||||
desired_shelf = get_object_or_404(
|
desired_shelf = get_object_or_404(
|
||||||
|
@ -98,7 +98,7 @@ def shelve(request):
|
||||||
@require_POST
|
@require_POST
|
||||||
def unshelve(request, book_id=False):
|
def unshelve(request, book_id=False):
|
||||||
"""remove a book from a user's shelf"""
|
"""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, "/")
|
next_step = validate_url_domain(next_step, "/")
|
||||||
identity = book_id if book_id else request.POST.get("book")
|
identity = book_id if book_id else request.POST.get("book")
|
||||||
book = get_object_or_404(models.Edition, id=identity)
|
book = get_object_or_404(models.Edition, id=identity)
|
||||||
|
|
|
@ -59,7 +59,7 @@ class CreateStatus(View):
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def post(self, request, status_type, existing_status_id=None):
|
def post(self, request, status_type, existing_status_id=None):
|
||||||
"""create status of whatever type"""
|
"""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, "/")
|
next_step = validate_url_domain(next_step, "/")
|
||||||
created = not existing_status_id
|
created = not existing_status_id
|
||||||
existing_status = None
|
existing_status = None
|
||||||
|
@ -170,7 +170,7 @@ def update_progress(request, book_id): # pylint: disable=unused-argument
|
||||||
def edit_readthrough(request):
|
def edit_readthrough(request):
|
||||||
"""can't use the form because the dates are too finnicky"""
|
"""can't use the form because the dates are too finnicky"""
|
||||||
# TODO: remove this, it duplicates the code in the ReadThrough view
|
# 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, "/")
|
next_step = validate_url_domain(next_step, "/")
|
||||||
readthrough = get_object_or_404(models.ReadThrough, id=request.POST.get("id"))
|
readthrough = get_object_or_404(models.ReadThrough, id=request.POST.get("id"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue