diff options
| author | 2021-05-06 19:28:18 +0200 | |
|---|---|---|
| committer | 2021-05-06 19:28:18 +0200 | |
| commit | 425b4f1d2f71b42f197dbaacd7926a5431a74a45 (patch) | |
| tree | 4a8b4124072868ef86dbf869f3e0fcfc7102c423 /tests/base.py | |
| parent | Merge pull request #1561 from dawnofmidnight/patch-1 (diff) | |
Prevent accidental addition of users to talentpool
Bug: When asking for a review for a user that isn't currently nominated
using the `!talentpool get_review <userid>` command, the user is added
to the talentpool `watched_users` cache, causing their messages to be
relayed to the talentpool watch channel.
Steps to reproduce: Use `!talentpool get_review <user_id>`, where
`<user_id>` is the ID of a user not currently nominated. The command
will correctly reply that the user isn't nominated, but their ID will be
added as a key to the defaultdict nonetheless.
Solution: replace all regular getitem usages with `.get(<user_id>)`, as
the Reviewer should never insert IDs using the regular defaultdict path.
Additional note: I've replaced all occurrences of regular getitem access
into the defaultdict, even those that are normally not reachable with
the id of a user that's currently not nominated, to prevent a future
refactor from accidentally introducing this bug again.
Diffstat (limited to 'tests/base.py')
0 files changed, 0 insertions, 0 deletions