Use datetime.now().date() instead of today().
This commit is contained in:
@@ -3,12 +3,9 @@ Contains the election cycle class
|
||||
"""
|
||||
|
||||
import collections
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import UTC, datetime, timedelta
|
||||
|
||||
import nextcord
|
||||
from sqlalchemy import select, true, update
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from classes.nominate_highcouncil_views import NominateHighCouncilView
|
||||
from classes.nominate_views import NominateView
|
||||
from classes.voting_highcouncil_views import VoteHighcouncilView
|
||||
@@ -20,6 +17,8 @@ from database_setup.sql_data_classes import (
|
||||
Votes,
|
||||
engine,
|
||||
)
|
||||
from sqlalchemy import select, true, update
|
||||
from sqlalchemy.orm import Session
|
||||
from utils import (
|
||||
TEMPLATES_DIR,
|
||||
VoteType,
|
||||
@@ -143,7 +142,7 @@ class ElectionCycle:
|
||||
"""
|
||||
Function checks current date to see if something needs to be run.
|
||||
"""
|
||||
today = datetime.today()
|
||||
today = datetime.now(tz=UTC).date()
|
||||
|
||||
# check all dates if action is needed
|
||||
if today.date() == self.election_start.date():
|
||||
|
||||
Reference in New Issue
Block a user