diff --git a/insert_wordpress.py b/insert_wordpress.py index 0f1b2fa..854c412 100644 --- a/insert_wordpress.py +++ b/insert_wordpress.py @@ -110,7 +110,7 @@ class WPimport: for k in elements[i]: if k["name"] == j: element_exist = True - array = listelement[i].append(k["id"]) + listelement[i].append(k["id"]) if element_exist is False: data = {"name": j} page = requests.post("http://{0}/wp-json/wp/v2/{1}".format(self.wordpress, i), auth=self.basic, data=data) @@ -145,7 +145,7 @@ class WPimport: params = {"search":title} page = requests.get("http://{0}/wp-json/wp/v2/posts".format(self.wordpress), auth=self.basic, params=params) page_exist = True - if page.status_code: + if page.status_code == 200: result = page.json() if len(result) == 0: page_exist = False