Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thehaffk committed Jul 12, 2023
1 parent 107d107 commit 7b0f508
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mkovotebot/ext/mko_voting.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class MKOVoting(commands.Cog):
def __init__(self, bot: disnake.ext.commands.Bot):
self.bot = bot

async def update_voter(self, discord_id: int) -> bool:
async def update_voter(self, discord_id: int, from_uc: bool = False) -> bool:
"""
Check voter - hours and player role
Expand Down Expand Up @@ -123,7 +123,8 @@ async def update_voter(self, discord_id: int) -> bool:
text="Голосование МКО"
),
)
await self.update_candidate(current_vote.candidate_id, update_voters=False)
if not from_uc:
await self.update_candidate(current_vote.candidate_id, update_voters=False)
return False

return True
Expand Down Expand Up @@ -172,7 +173,7 @@ async def update_candidate(self, discord_id: int, update_voters: bool = False) -
if update_voters:
updated_votes = []
for vote in votes:
if await self.update_voter(discord_id=vote.voter_id):
if await self.update_voter(discord_id=vote.voter_id, from_uc=True):
updated_votes.append(vote)
votes = updated_votes

Expand Down

0 comments on commit 7b0f508

Please sign in to comment.