use received_at for ingesting emails and feed generation (#22)

* use received_at for ingesting emails and feed generation

* fix test
This commit is contained in:
Matt
2025-10-21 14:45:14 -04:00
committed by GitHub
parent 54285a2ab8
commit 35fdb8b615
5 changed files with 18 additions and 3 deletions

View File

@@ -41,11 +41,14 @@ def _add_entries_to_feed(
else entry.subject
)
fe.content(entry.body, type="html")
if entry.received_at.tzinfo is None:
timezone_aware_received_at = entry.received_at.replace(tzinfo=tz.tzutc())
fe.published(timezone_aware_received_at)
fe.updated(timezone_aware_received_at)
else:
fe.published(entry.received_at)
fe.updated(entry.received_at)
def generate_feed(db: Session, feed_identifier: str):