Runs black

This commit is contained in:
Mouse Reeve
2021-03-08 08:49:10 -08:00
parent a07f955781
commit 70296e760b
198 changed files with 10239 additions and 8572 deletions

View File

@ -1,4 +1,4 @@
''' isbn search view '''
""" isbn search view """
from django.http import HttpResponseNotFound
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect
@ -13,17 +13,18 @@ from .helpers import is_api_request
# pylint: disable= no-self-use
class Isbn(View):
''' search a book by isbn '''
""" search a book by isbn """
def get(self, request, isbn):
''' info about a book '''
""" info about a book """
book_results = connector_manager.isbn_local_search(isbn)
if is_api_request(request):
return JsonResponse([r.json() for r in book_results], safe=False)
data = {
'title': 'ISBN Search Results',
'results': book_results,
'query': isbn,
"title": "ISBN Search Results",
"results": book_results,
"query": isbn,
}
return TemplateResponse(request, 'isbn_search_results.html', data)
return TemplateResponse(request, "isbn_search_results.html", data)