From c57056e5869373150cdc0899e19461747ac4b97b Mon Sep 17 00:00:00 2001 From: Abigail Date: Thu, 20 Feb 2020 01:32:17 -0500 Subject: [PATCH] fix offset-naive and offset-aware datetime conflict Fixes #201 --- CHANGELOG.md | 5 +++++ exts/study.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f149c9..dd798c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [2.2.1] - 2020-02-20 +### Fixed +- Fixed issue where some HamStudy pools will become unselectable. + + ## [2.2.0] - 2020-02-15 ### Added - Added Trustee field to qrz command for club callsigns. diff --git a/exts/study.py b/exts/study.py index 1576de2..774c35e 100644 --- a/exts/study.py +++ b/exts/study.py @@ -14,6 +14,7 @@ from datetime import datetime import asyncio import aiohttp +import pytz import discord.ext.commands as commands @@ -88,8 +89,8 @@ class StudyCog(commands.Cog): else: # look at valid_from and expires dates to find the correct one for p in pool_matches: - valid_from = datetime.fromisoformat(pools[p]["valid_from"][:-1] + "+00:00") - expires = datetime.fromisoformat(pools[p]["expires"][:-1] + "+00:00") + valid_from = datetime.fromisoformat(pools[p]["valid_from"][:-1]) + expires = datetime.fromisoformat(pools[p]["expires"][:-1]) if valid_from < datetime.utcnow() < expires: pool = p