Skip to content

Commit 6dd0a7d

Browse files
committed
check time at argetnina time and not server time when calling the wizard
1 parent 6d0746f commit 6dd0a7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/pycamp_bot/models.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import peewee as pw
22

33
from datetime import datetime, timedelta
4+
import datetime
5+
from zoneinfo import ZoneInfo
6+
from pycamp_bot.logger import logger
7+
48
from random import choice
59

610

@@ -105,7 +109,8 @@ def get_wizards(self):
105109

106110
def get_current_wizard(self):
107111
"""Return the Pycampista instance that's the currently scheduled wizard."""
108-
now = datetime.now()
112+
now = datetime.datetime.now(ZoneInfo("America/Los_Angeles"))
113+
logger.info("Request wizard at user time: %s", str(now))
109114
current_wizards = WizardAtPycamp.select().where(
110115
(WizardAtPycamp.pycamp == self) &
111116
(WizardAtPycamp.init <= now) &

0 commit comments

Comments
 (0)