From 54ab23a0e49fcd7d0a124c642ad008b0e6a15855 Mon Sep 17 00:00:00 2001 From: Liam Steckler Date: Sat, 13 Jan 2024 22:39:20 -0800 Subject: [PATCH] Don't post small outages --- scl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scl.py b/scl.py index 0547ece..bbf21e4 100644 --- a/scl.py +++ b/scl.py @@ -176,7 +176,11 @@ with Session(engine) as session: session.commit() except NoResultFound: - # TODO: Logic to post initial to Mastodon, + if outage_size == "Small": + # If the outage becomes medium/large, it'll then be posted as a new outage on the next run + print("Outage is small, will not post") + continue + print("Existing record not found") post_text = """Seattle City Light is reporting a {} outage in {}.