diff options
| author | jason | 2016-09-06 18:45:22 -0600 |
|---|---|---|
| committer | jason | 2016-09-06 18:45:22 -0600 |
| commit | 13bc4770fd7f314debd0e16b4ae52f68b6779330 (patch) | |
| tree | 8918d88eba1061db5a8cfeac3b19d457cacfe2ff /warmachine/addons/standup.py | |
| parent | a68ecdfb5a472924ca13d562a866642004415b27 (diff) | |
| download | warmachine-ng-13bc4770fd7f314debd0e16b4ae52f68b6779330.tar.gz warmachine-ng-13bc4770fd7f314debd0e16b4ae52f68b6779330.zip | |
Fix crash cleaning up channels waiting for a reply
- When a user answers standup the channel is removed from the awaiting
reply list. The job to clean up any non-answers is already schedule so
when cleaning up for the next day, warmachine would crash because it
couldn't find the channel to remove.
Diffstat (limited to 'warmachine/addons/standup.py')
| -rw-r--r-- | warmachine/addons/standup.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/warmachine/addons/standup.py b/warmachine/addons/standup.py index f6f8b06..15281f5 100644 --- a/warmachine/addons/standup.py +++ b/warmachine/addons/standup.py | |||
| @@ -316,6 +316,10 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 316 | for u in users: | 316 | for u in users: |
| 317 | if u == connection.nick or \ | 317 | if u == connection.nick or \ |
| 318 | u in self.standup_schedules[channel]['ignoring']: | 318 | u in self.standup_schedules[channel]['ignoring']: |
| 319 | try: | ||
| 320 | users.remove(u) | ||
| 321 | except ValueError: | ||
| 322 | pass | ||
| 319 | continue | 323 | continue |
| 320 | 324 | ||
| 321 | if u in self.users_awaiting_reply and \ | 325 | if u in self.users_awaiting_reply and \ |
| @@ -448,7 +452,11 @@ class StandUpPlugin(WarMachinePlugin): | |||
| 448 | if u in self.users_awaiting_reply: | 452 | if u in self.users_awaiting_reply: |
| 449 | self.log.info('Clearing channel {} from list of waiting ' | 453 | self.log.info('Clearing channel {} from list of waiting ' |
| 450 | 'channels for user {}'.format(channel, u)) | 454 | 'channels for user {}'.format(channel, u)) |
| 451 | self.users_awaiting_reply[u]['for_channels'].remove(channel) | 455 | |
| 456 | try: | ||
| 457 | self.users_awaiting_reply[u]['for_channels'].remove(channel) | ||
| 458 | except ValueError as e: | ||
| 459 | pass | ||
| 452 | 460 | ||
| 453 | # if that was the last channel, kill any pester tasks | 461 | # if that was the last channel, kill any pester tasks |
| 454 | if not self.users_awaiting_reply[u]['for_channels'] and \ | 462 | if not self.users_awaiting_reply[u]['for_channels'] and \ |