Compare commits

..
Author SHA1 Message Date
imcompiling 4c1f41c4c8 Correct date being used for getting the election cycle name.
build_develop / build (push) Successful in 1m39s
2023-12-28 19:28:30 -05:00
+3 -8
View File
@@ -31,9 +31,6 @@ def get_datetime(day: str) -> datetime:
if datetime.today().month == 12 and month < 12:
year += 1
if datetime.today().month == 1 and month > 1:
year -= 1
return datetime(year, month, day)
@@ -50,9 +47,7 @@ def get_election_cycle_name(config: DakinyConfig) -> str:
cycle = get_current_cycle(config)
current_cycle = config.election_cycles[cycle]
return (
f"vote-{get_datetime(current_cycle.election_start).year}-{current_cycle.name}"
)
return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
def get_dm_election_name(config: DakinyConfig) -> str:
@@ -91,7 +86,7 @@ def get_current_cycle(config: DakinyConfig) -> int:
config (DakinyConfig): Config object to use
Returns:
int: cycle index for active election. None for no active cycle
int: cycle index for active election. -1 for no active cycle
"""
today = datetime.today()
@@ -103,7 +98,7 @@ def get_current_cycle(config: DakinyConfig) -> int:
):
return cycle
return None
return -1
def build_votes_str(config: DakinyConfig) -> str: