Fix small bugs with getting cycle name and recording events.
This commit is contained in:
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user