Feat: Update Nominate classes to use models.
build_develop / build (push) Successful in 44s

This commit is contained in:
2025-07-24 14:28:39 -04:00
parent 530ca5b172
commit 45f17e09d3
2 changed files with 50 additions and 38 deletions
@@ -84,9 +84,7 @@ class NominateDMModal(nextcord.ui.Modal):
session.commit()
else:
msg: nextcord.Message = await interaction.channel.fetch_message(council_elect.discord_manager_speech_id)
await msg.edit(
content=decorate_dm_nomination(interaction.user.id, self.speech.value if self.speech.value else "")
)
await msg.edit(content=speech)
class NominateCLModal(nextcord.ui.Modal):
@@ -155,9 +153,7 @@ class NominateCLModal(nextcord.ui.Modal):
session.commit()
else:
msg: nextcord.Message = await interaction.channel.fetch_message(council_elect.clan_leader_speech_id)
await msg.edit(
content=decorate_cl_nomination(interaction.user.id, self.speech.value if self.speech.value else "")
)
await msg.edit(content=speech)
class NominateHighCouncilView(nextcord.ui.View):
@@ -210,12 +206,7 @@ class NominateHighCouncilView(nextcord.ui.View):
)
council_elect = session.scalar(stmt)
if council_elect is None:
dakiny_logger.error("Did not find member (id: %s) in election %s.", interaction.user.id, election_name)
return
# user needs to exist to get here anyways...
if council_elect.discord_manager_speech_id is not None:
if council_elect is not None and council_elect.discord_manager_speech_id is not None:
usr_nominated = True
msg = await interaction.channel.fetch_message(council_elect.discord_manager_speech_id)
speech_content = msg.content.split(NOMINEE_SPLITTER)[1]
@@ -265,12 +256,7 @@ class NominateHighCouncilView(nextcord.ui.View):
)
council_elect = session.scalar(stmt)
if council_elect is None:
dakiny_logger.error("Did not find member (id: %s) in election %s.", interaction.user.id, election_name)
return
# user needs to exist to get here anyways...
if council_elect.clan_leader_speech_id is not None:
if council_elect is not None and council_elect.clan_leader_speech_id is not None:
usr_nominated = True
msg = await interaction.channel.fetch_message(council_elect.clan_leader_speech_id)
speech_content = msg.content.split(NOMINEE_SPLITTER)[1]