Don't break if poll doesn't have an expiry date
This commit is contained in:
parent
24cfa48dea
commit
e318581dd1
1 changed files with 8 additions and 6 deletions
|
@ -334,13 +334,15 @@ class StatusDetails(urwid.Pile):
|
|||
yield urwid.Text(option["title"])
|
||||
yield urwid.ProgressBar("", "poll_bar", perc)
|
||||
|
||||
if poll["expired"]:
|
||||
status = "Closed"
|
||||
else:
|
||||
expires_at = parse_datetime(poll["expires_at"]).strftime("%Y-%m-%d %H:%M")
|
||||
status = "Closes on {}".format(expires_at)
|
||||
status = "Poll · {} votes".format(poll["votes_count"])
|
||||
|
||||
if poll["expired"]:
|
||||
status += " · Closed"
|
||||
|
||||
if poll["expires_at"]:
|
||||
expires_at = parse_datetime(poll["expires_at"]).strftime("%Y-%m-%d %H:%M")
|
||||
status += " · Closes on {}".format(expires_at)
|
||||
|
||||
status = "Poll · {} votes · {}".format(poll["votes_count"], status)
|
||||
yield urwid.Text(("gray", status))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue