diff --git a/lambdas/wo/web_ui/handler.py b/lambdas/wo/web_ui/handler.py index 4168942..f8bb0a5 100644 --- a/lambdas/wo/web_ui/handler.py +++ b/lambdas/wo/web_ui/handler.py @@ -40,6 +40,8 @@ def get_comments(work_order_id): def render_badge(value, color_map): + if not value: + value = "unknown" color = color_map.get(value, "#9ca3af") label = esc(value.replace("_", " ").title()) return f'{label}' @@ -163,7 +165,7 @@ def render_work_orders_list(work_orders): status = wo.get("wo_status", "unknown") record_type = wo.get("record_type", "unknown") due = esc(wo.get("due_date", "")) - updated = esc(wo.get("updated_at", "")[:16]) + updated = esc((wo.get("updated_at") or "")[:16]) rows += f""" diff --git a/scripts/backfill_sites.py b/scripts/backfill_sites.py index 121d5ca..f2b9909 100644 --- a/scripts/backfill_sites.py +++ b/scripts/backfill_sites.py @@ -8,7 +8,7 @@ Usage: import sys import os -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lambdas", "site_extractor")) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "lambdas", "po", "site_extractor")) import boto3 from handler import extract_site_code, parse_address, upsert_site