Remove config param from get_quarter_name().

This commit is contained in:
2024-09-03 16:04:33 -04:00
parent 8dc2668f44
commit 1dd5a33da5
+5 -5
View File
@@ -69,7 +69,7 @@ def get_election_name() -> str:
return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}" return f"vote-{get_datetime(current_cycle.term_start).year}-{current_cycle.name}"
def get_quarter_name(config: DakinySettings) -> str: def get_quarter_name() -> str:
""" """
Builds the name of the current cycle/quarter. Builds the name of the current cycle/quarter.
@@ -79,8 +79,8 @@ def get_quarter_name(config: DakinySettings) -> str:
Returns: Returns:
str: the name of the cycle. str: the name of the cycle.
""" """
cycle = get_quarter_cycle(config) cycle = get_quarter_cycle(settings)
current_cycle = config.election_cycles[cycle] current_cycle = settings.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}"
@@ -312,7 +312,7 @@ def record_event_points(config: DakinySettings, users: Sequence[str], add_points
add_points (int): number of points to add add_points (int): number of points to add
is_member (bool): whether the users are a discord member or not is_member (bool): whether the users are a discord member or not
""" """
quarter_name = get_quarter_name(config) quarter_name = get_quarter_name()
with Session(engine) as session: with Session(engine) as session:
for user in users: for user in users:
stmt = select(EventPoints).where(EventPoints.UserId == user).where(EventPoints.QuarterName == quarter_name) stmt = select(EventPoints).where(EventPoints.UserId == user).where(EventPoints.QuarterName == quarter_name)
@@ -537,7 +537,7 @@ async def edit_clan_council_info(guild: nextcord.Guild, config: DakinySettings)
f"<@{user_id}>" for user_id in council_member_ids if user_id not in (discord_manager, clan_leader) f"<@{user_id}>" for user_id in council_member_ids if user_id not in (discord_manager, clan_leader)
] ]
quarter = get_quarter_name(config) quarter = get_quarter_name()
async with aiofiles.open(f"{TEMPLATES_DIR}/council_members.txt", encoding="utf8") as file: async with aiofiles.open(f"{TEMPLATES_DIR}/council_members.txt", encoding="utf8") as file:
message = await file.read() message = await file.read()