From 8f786b4dfa811d40f42201b54d1d49b528483031 Mon Sep 17 00:00:00 2001 From: Liam Steckler Date: Sat, 13 Jan 2024 15:00:05 -0800 Subject: [PATCH] Make follow-up posts be unlisted --- scl.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scl.py b/scl.py index 7944a57..56601a2 100644 --- a/scl.py +++ b/scl.py @@ -36,17 +36,13 @@ class SclOutage(Base): __tablename__ = "scl_outages" scl_outage_id: Mapped[int] = mapped_column(primary_key=True, unique=True) outage_user_id: Mapped[str] = mapped_column() - most_recent_post_id: Mapped[str] = mapped_column() + most_recent_post_id: Mapped[Optional[str]] = mapped_column() last_updated_time: Mapped[datetime] = mapped_column() estimated_restoration_time: Mapped[datetime] = mapped_column() cause: Mapped[str] = mapped_column() outage_size: Mapped[str] = mapped_column() status: Mapped[Optional[str]] = mapped_column() - no_longer_in_response_time: Mapped[ - Optional[datetime] - ] = ( - mapped_column() - ) # If the event is no longer being returned in the response, this will be set to the current time + no_longer_in_response_time: Mapped[Optional[datetime]] = mapped_column() def __repr__(self) -> str: return f"SclOutage(scl_outage_id={self.scl_outage_id!r}, most_recent_post_id={self.most_recent_post_id!r}, last_updated_time={self.last_updated_time!r}, no_longer_in_response_time={self.no_longer_in_response_time!r})" @@ -130,7 +126,7 @@ with Session(engine) as session: mastodon_post_result = mastodon.status_post( status="\n".join(updated_entries), in_reply_to_id=existing_record.most_recent_post_id, - visibility="public", + visibility="unlisted", ) existing_record.most_recent_post_id = mastodon_post_result["id"] @@ -183,7 +179,7 @@ Cause: {} active_outage.outage_user_id ), in_reply_to_id=active_outage.most_recent_post_id, - visibility="public", + visibility="unlisted", ) active_outage.most_recent_post_id = mastodon_post_result["id"]