mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2025-07-07 13:04:01 +02:00
Fix linters
This commit is contained in:
@ -41,7 +41,8 @@ class MediaAdminForm(ModelForm):
|
||||
Download data from google books
|
||||
:return True if success
|
||||
"""
|
||||
api_url = "https://www.googleapis.com/books/v1/volumes?q=ISBN:{}".format(isbn)
|
||||
api_url = "https://www.googleapis.com/books/v1/volumes?q=ISBN:{}"\
|
||||
.format(isbn)
|
||||
with urllib.request.urlopen(api_url) as url:
|
||||
data = json.loads(url.read().decode())
|
||||
|
||||
@ -173,7 +174,8 @@ class MediaAdminForm(ModelForm):
|
||||
if not scrap_result:
|
||||
# Try with OpenLibrary
|
||||
if not self.download_data_openlibrary(isbn):
|
||||
self.add_error('isbn', _("This ISBN is not found."))
|
||||
self.add_error('isbn',
|
||||
_("This ISBN is not found."))
|
||||
return self.cleaned_data
|
||||
|
||||
if self.cleaned_data['title']:
|
||||
|
Reference in New Issue
Block a user