From 4432bf9ff2c880f8714e3cd0283c8940f6ad6008 Mon Sep 17 00:00:00 2001 From: Faisal Shahzad <84210709+seowings@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:00:30 +0200 Subject: [PATCH] updated crawling checks --- src/staticwordpress/core/project.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/staticwordpress/core/project.py b/src/staticwordpress/core/project.py index cc42a86..845399a 100644 --- a/src/staticwordpress/core/project.py +++ b/src/staticwordpress/core/project.py @@ -135,10 +135,12 @@ def is_valid(self) -> bool: ) def has_github(self) -> bool: - return self["github"]["token"] != "" or self["github"]["repository"] != "" + return self["github"]["token"] != "" and self["github"]["repository"] != "" def has_wordpress(self) -> bool: - return self["wordpress"]["api-token"] != "" or self["wordpress"]["user"] != "" + return self["source"]["type"] == SOURCE.CRAWL or ( + self["wordpress"]["api-token"] != "" and self["wordpress"]["user"] != "" + ) def can_crawl(self) -> bool: return all(