From 443609f5ba3acbdfa7e037664902dee343a1c27b Mon Sep 17 00:00:00 2001 From: imcompiling Date: Thu, 9 May 2024 20:57:36 -0400 Subject: [PATCH] Fix small bugs with getting cycle name and recording events. --- utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index ed0d575..8775a9e 100644 --- a/utils.py +++ b/utils.py @@ -73,7 +73,7 @@ def get_cycle_name(config: DakinyConfig) -> str: cycle = get_current_cycle(config) current_cycle = config.election_cycles[cycle] - return f"{get_datetime(current_cycle.term_start.year)}-{current_cycle.name}" + return f"{get_datetime(current_cycle.term_start).year}-{current_cycle.name}" def get_dm_election_name(config: DakinyConfig) -> str: @@ -332,7 +332,7 @@ def record_event_participation(config: DakinyConfig, users: list[str], is_member is_member (bool): whether the users are a discord member or not """ - cycle = get_current_cycle(config) + cycle = get_cycle_name(config) participation_point_value = config.params.event_participate_points with Session(engine) as session: for user in users: @@ -366,7 +366,7 @@ def record_event_host(config: DakinyConfig, user: int): config (DakinyConfig): Dakiny config for getting points user (int): Id of user that hosted. """ - cycle = get_current_cycle(config) + cycle = get_cycle_name(config) host_point_value = config.params.event_host_points with Session(engine) as session: stmt = (