From 963f83ae81cf8735d68ceff5e50e5849e7e10da1 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 2 Sep 2023 00:26:50 +0200 Subject: [PATCH] fix author --- lib/WPImport.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/WPImport.py b/lib/WPImport.py index 56c51a7..d0240a9 100644 --- a/lib/WPImport.py +++ b/lib/WPImport.py @@ -237,7 +237,9 @@ class WPimport: break author = self._getInfoAlbum(href_a) self._logger.info("{0} : author : {1}".format(self._name, author)) - self._getAuthor(author) + author = self._getAuthor(author) + data = {"title":albumtitle, "content":content_html, "status":"publish"} + if author != 0: data = {"title":albumtitle, "content":content_html, "status":"publish", "author":author} self._logger.debug("{0} : data for album page : {1}".format(self._name, data)) @@ -849,7 +851,9 @@ class WPimport: self._logger.error("{0} : Exception error for post {1} : {2}".format(self._name, i, err)) title = articletitle[0].text - author = articleacreator[0].text.lower() + author = articleacreator[0].text.lower() + if len(self._author) > 0: + author = self._author body = articlebody[0].find_all("p") bodyhtml = "

" for i in body: