Skip to content

Commit

Permalink
Fixed critical bug when removing expired licenses.
Browse files Browse the repository at this point in the history
The loop would stop if Forbidden happens, meaning all other members down the line won't get checked for role expiration.
Fixed now by adding Exception for all cases.
  • Loading branch information
albertopoljak committed May 25, 2020
1 parent 4d5f4eb commit a5f2c96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cogs/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ async def check_all_active_licenses(self):
"Removing all entries of it from database!")
await self.bot.main_db.remove_all_guild_data(member_guild_id, guild_table_too=True)
logger.info(f"Successfully deleted all database data for guild {member_guild_id}")
return
continue
except Exception as e3:
logger.warning(f"Can't remove role {licensed_role_id } from member {member_id } guild {member_guild_id }, ignoring error: {e3}")
continue
await self.bot.main_db.delete_licensed_member(member_id, licensed_role_id)
logger.info(f"Role {licensed_role_id} successfully removed from member:{member_id}")

Expand Down

1 comment on commit a5f2c96

@Lemon553311-dev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Please sign in to comment.