aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
Diffstat (limited to 'webmentions_ssg/tasks/scanner.py')
-rw-r--r--webmentions_ssg/tasks/scanner.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index b2d6def..1b1c6ef 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -133,9 +133,7 @@ def scan_sources_task() -> None:
if not root.is_dir():
raise RuntimeError(f"Source directory is not a directory: {root}")
- base_url = current_app.config.get("SOURCE_BASE_URL")
-
- if base_url is not None:
+ if (base_url := current_app.config.get("SOURCE_BASE_URL")) is not None:
if not is_http_url(base_url):
raise RuntimeError("SOURCE_BASE_URL must be an absolute HTTP or HTTPS URL")
base_url = f"{base_url.rstrip('/')}/"
@@ -146,6 +144,7 @@ def scan_sources_task() -> None:
sa.select(Source).options(selectinload(Source.sent_webmentions))
)
}
+
# Existing sources retain their canonical URLs even when marked deleted.
# Reserve these URLs before scanning so an alias cannot claim one just
# because it is discovered earlier than its persisted owner.