mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-24 02:21:04 +00:00
code cleanup
This commit is contained in:
parent
b406a03533
commit
a3270551f9
4 changed files with 6 additions and 2 deletions
|
@ -93,8 +93,10 @@ let StatusCache = new class {
|
|||
if (response.headers.get("forceReload")) {
|
||||
BookWyrm.addRemoveClass(form, 'is-processing', true);
|
||||
trigger.setAttribute('disabled', null);
|
||||
|
||||
return location.reload();
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error();
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ from .helpers import load_date_in_user_tz_as_utc
|
|||
|
||||
@method_decorator(login_required, name="dispatch")
|
||||
# pylint: disable=no-self-use
|
||||
# pylint: disable=too-many-return-statements
|
||||
class ReadingStatus(View):
|
||||
"""consider reading a book"""
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@ def shelve(request):
|
|||
@require_POST
|
||||
def unshelve(request, referer=None, book_id=False):
|
||||
"""remove a book from a user's shelf"""
|
||||
id = book_id if book_id else request.POST.get("book")
|
||||
book = get_object_or_404(models.Edition, id=id)
|
||||
identity = book_id if book_id else request.POST.get("book")
|
||||
book = get_object_or_404(models.Edition, id=identity)
|
||||
shelf_book = get_object_or_404(
|
||||
models.ShelfBook, book=book, shelf__id=request.POST["shelf"]
|
||||
)
|
||||
|
|
|
@ -54,6 +54,7 @@ class CreateStatus(View):
|
|||
data = {"book": book}
|
||||
return TemplateResponse(request, "compose.html", data)
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
def post(self, request, status_type, existing_status_id=None):
|
||||
"""create status of whatever type"""
|
||||
created = not existing_status_id
|
||||
|
|
Loading…
Reference in a new issue