1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-07 18:40:13 +02:00

Add a model to store future media list.

This commit is contained in:
Yohann D'ANELLO
2020-05-12 17:33:32 +02:00
parent adbaf66401
commit ea30cdec6e
3 changed files with 36 additions and 4 deletions

View File

@ -41,7 +41,7 @@ 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())
@ -234,8 +234,6 @@ class MediaAdminForm(ModelForm):
).casefold().upper()
self.cleaned_data['side_identifier'] = side_identifier
print(self.cleaned_data)
return self.cleaned_data
def _clean_fields(self):