From: Michael Tremer Date: Fri, 20 Feb 2026 17:56:47 +0000 (+0000) Subject: sources: Convert modification timestamps to UTC X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f709cf4cfea25313a65f672fd1ba9a164d3d4dc6;p=dbl.git sources: Convert modification timestamps to UTC The asyncpg driver does not seem to like offset-aware and offset-unaware timestamps. Signed-off-by: Michael Tremer --- diff --git a/src/dbl/sources.py b/src/dbl/sources.py index 6bd7e41..9e88b94 100644 --- a/src/dbl/sources.py +++ b/src/dbl/sources.py @@ -381,7 +381,11 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True): # Store Last-Modified last_modified = headers.get("Last-Modified") if last_modified: - self.last_modified_at = email.utils.parsedate_to_datetime(last_modified) + # Parse the timestamp + t = email.utils.parsedate_to_datetime(last_modified) + + # Store as UTC + self.last_modified_at = t.replace(tzinfo=None) # Store the ETag self.etag = headers.get("ETag")