move functions to get election cycle index and name into utils.
build_develop / build (push) Successful in 1m52s

This commit is contained in:
2023-11-02 14:44:26 -04:00
parent 63e3b3edb2
commit 647af0353d
3 changed files with 36 additions and 18 deletions
+4 -2
View File
@@ -152,7 +152,7 @@ class ElectionCycle:
"""
# create new channel for election
category: nextcord.CategoryChannel = self.guild.get_channel(self.config.params.active_category_id)
quarter_name: str = get_election_cycle_name()
quarter_name: str = get_election_cycle_name(self.config)
# create new entry into database.
election_channel: nextcord.TextChannel = await category.create_text_channel(quarter_name)
@@ -226,5 +226,7 @@ class ElectionCycle:
"""
with Session(engine) as session:
stmt = select(ElectionInformation).where(ElectionInformation.ElectionCycle == get_election_cycle_name())
stmt = select(ElectionInformation).where(
ElectionInformation.ElectionCycle == get_election_cycle_name(self.config)
)
return session.scalar(stmt)