From 6ddc108d72e4794732a93b5aaac85ecbf409cda0 Mon Sep 17 00:00:00 2001 From: dcronin05 Date: Sat, 5 Oct 2024 08:06:41 -0500 Subject: [PATCH] broke the mysql database --- src/extract.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/extract.py b/src/extract.py index 9578b33..9c2882b 100644 --- a/src/extract.py +++ b/src/extract.py @@ -68,7 +68,7 @@ def create_page(r): request = lib.api.post_pages_create({ 'chapter_id': chapter_id['id'] if chapter_id else "", - 'tags': t_list if len(tags) > 0 else "[]", + 'tags': t_list if len(tags) > 0 else [], 'book_id': 3, 'page_id': pk, 'name': name, @@ -77,9 +77,11 @@ def create_page(r): if 'error' in request: print("\n\ndidn't work: ") - print(request['error']['message']) + if 'validation' in request['error']: + print(request['error']['validation']) + else: print(str(request['error'])[0:1000]) print(t_list) - else: print("\n\nWorked: \n", t_list, "\n", request['name']) + print(markdown[0:200]) def tag_exists(t): tag = lib.db.find_one({"pk": t['pk']})