From 3a9e4956a230024cb8de3fb7fb45938adc96512c Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Sun, 12 Feb 2023 09:41:04 +0100 Subject: [PATCH] Don't break if edited_at does not exist Introduced in mastodon 4. fixes #309 --- toot/tui/timeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toot/tui/timeline.py b/toot/tui/timeline.py index 9059f5e..41bc1f8 100644 --- a/toot/tui/timeline.py +++ b/toot/tui/timeline.py @@ -427,7 +427,7 @@ class StatusDetails(urwid.Pile): class StatusListItem(SelectableColumns): def __init__(self, status): - edited = status.data["edited_at"] + edited_at = status.data.get("edited_at") # TODO: hacky implementation to avoid creating conflicts for existing # pull reuqests, refactor when merged. @@ -437,7 +437,7 @@ class StatusListItem(SelectableColumns): else status.created_at.strftime("%Y-%m-%d %H:%M") ) - edited_flag = "*" if edited else " " + edited_flag = "*" if edited_at else " " favourited = ("yellow", "★") if status.original.favourited else " " reblogged = ("yellow", "♺") if status.original.reblogged else " " is_reblog = ("cyan", "♺") if status.reblog else " "