From 263b4cff77c66f1b8ead9dcbd0fa51c53c67d613 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 3 Oct 2020 15:41:49 +0200 Subject: [PATCH] Incorrect use of Authorization header --- media/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/media/forms.py b/media/forms.py index 23a162b..ee95296 100644 --- a/media/forms.py +++ b/media/forms.py @@ -97,7 +97,8 @@ class MediaAdminForm(ModelForm): req.add_header("Authorization", os.getenv("ISBNDB_KEY")) with urllib.request.urlopen(req) as url: data = json.loads(url.read().decode()) - self.cleaned_data["title"] = data["title_long"] + print(data) + self.cleaned_data["title"] = data["title"] self.cleaned_data["published_date"] = data["date_published"][:10] self.cleaned_data["number_of_pages"] = data["pages"] self.cleaned_data["authors"] = \