1
0
mirror of https://git.sr.ht/~tsileo/microblog.pub synced 2025-06-05 21:59:23 +02:00

Add support for displaying Page object

This commit is contained in:
Thomas Sileo
2022-07-20 20:59:29 +02:00
parent 7ba2408c8d
commit 4a975dcbfa
4 changed files with 25 additions and 9 deletions

View File

@ -315,7 +315,9 @@ def _timeago(original_dt: datetime) -> str:
def _has_media_type(attachment: Attachment, media_type_prefix: str) -> bool:
return attachment.media_type.startswith(media_type_prefix)
if attachment.media_type:
return attachment.media_type.startswith(media_type_prefix)
return False
def _format_date(dt: datetime) -> str: