Trying to figure out why the elections are not starting.
This commit is contained in:
@@ -20,6 +20,7 @@ from dakiny_bot.database.sql_data_classes import (
|
||||
Votes,
|
||||
engine,
|
||||
)
|
||||
from dakiny_bot.logger import dakiny_logger
|
||||
|
||||
from .DakinySettings import settings
|
||||
|
||||
@@ -92,12 +93,14 @@ def get_active_election_cycle() -> int:
|
||||
int: cycle index for active election. None for no active cycle
|
||||
"""
|
||||
today = datetime.now(tz=UTC)
|
||||
dakiny_logger.debug("Today is %s", today)
|
||||
|
||||
for cycle, election in enumerate(settings.election_cycles):
|
||||
if (
|
||||
today.date() >= get_datetime(election.election_start).date()
|
||||
and today.date() <= get_datetime(election.term_start).date()
|
||||
):
|
||||
dakiny_logger.debug("Cycle is %d", cycle)
|
||||
return cycle
|
||||
|
||||
# It isn't a current election, get the quarter
|
||||
@@ -114,13 +117,16 @@ def get_quarter_cycle() -> int:
|
||||
int: cycle index for current cycle.
|
||||
"""
|
||||
today = datetime.now(tz=UTC)
|
||||
dakiny_logger.debug("Today is %s", today)
|
||||
for cycle, election in enumerate(settings.election_cycles):
|
||||
if (
|
||||
today.date() >= get_datetime(election.term_start).date()
|
||||
and today.date() <= get_datetime(election.term_end).date()
|
||||
):
|
||||
dakiny_logger.debug("Cycle is %d", cycle)
|
||||
return cycle
|
||||
|
||||
dakiny_logger.debug("Quarter cycle is None.")
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user