From 09a0d51843823017761455777d56da65d4f37feb Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 29 Feb 2024 15:15:17 -0800 Subject: [PATCH] pages: set page status to 200 if unset and loadState != 0 (#1563) Follow up to #1516, ensure page status is set to 200 if no status is provided, if loadState is not 0 --- backend/btrixcloud/pages.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/btrixcloud/pages.py b/backend/btrixcloud/pages.py index 784ec75c..91c5c3bb 100644 --- a/backend/btrixcloud/pages.py +++ b/backend/btrixcloud/pages.py @@ -70,6 +70,9 @@ class PageOps: page_id = uuid4() try: + status = page_dict.get("status") + if not status and page_dict.get("loadState"): + status = 200 page = Page( id=page_id, oid=oid, @@ -77,6 +80,7 @@ class PageOps: url=page_dict.get("url"), title=page_dict.get("title"), load_state=page_dict.get("loadState"), + status=status, timestamp=( from_k8s_date(page_dict.get("ts")) if page_dict.get("ts")