From 4111f7f01714364c2529ef1df290f63a8b3e7f17 Mon Sep 17 00:00:00 2001 From: Ian O'Malley Date: Tue, 24 Mar 2020 13:18:02 -0400 Subject: [PATCH] Replace any None JSON values with 'n/a' --- safaribooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/safaribooks.py b/safaribooks.py index 95c13a3..3628214 100644 --- a/safaribooks.py +++ b/safaribooks.py @@ -529,6 +529,10 @@ class SafariBooks: if "last_chapter_read" in response: del response["last_chapter_read"] + + for key, value in response.items(): + if value is None: + response[key] = 'n/a' return response