Commit 263b4cff authored by ynerant's avatar ynerant

Incorrect use of Authorization header

parent 91aeb28c
Pipeline #4240 failed with stages
in 3 minutes and 30 seconds
......@@ -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"] = \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment