From 4888b37b50e3e1eb550facc6dcdc8ec86dee5b3b Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Mon, 18 May 2026 09:10:29 -0400 Subject: [PATCH] TimeScoped.is_active: drop deprecated utcnow datetime.utcnow() emits a DeprecationWarning on 3.12 and is slated for removal. The date is only used for an ISO-format comparison, so a timezone-aware now() works the same. Signed-off-by: Charlie Tonneslan --- openstates/models/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstates/models/common.py b/openstates/models/common.py index d579a2840..86b31bf1b 100644 --- a/openstates/models/common.py +++ b/openstates/models/common.py @@ -99,7 +99,7 @@ class TimeScoped(BaseModel): ) def is_active(self) -> bool: - date = datetime.datetime.utcnow().date().isoformat() + date = datetime.datetime.now(datetime.timezone.utc).date().isoformat() return (self.end_date == "" or str(self.end_date) > date) and ( self.start_date == "" or str(self.start_date) <= date )