aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-02-27 18:11:54 +0100
committerGravatar GitHub <[email protected]>2020-02-27 18:11:54 +0100
commitaa5c905d5dc368e4132c37656be504548578aac4 (patch)
tree1b43815dd26337a799da8763d349e45fe9fd504a
parentMerge pull request #785 from Numerlor/channel_constants_check (diff)
parentModeration: fix task cancellation for permanent infraction when editing (diff)
Merge pull request #798 from python-discord/bug/mod/bot-1v/infr-edit-task-cancel
Moderation: fix task cancellation for permanent infraction when editing
-rw-r--r--bot/cogs/moderation/management.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index f2964cd78..f74089056 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -129,7 +129,9 @@ class ModManagement(commands.Cog):
# Re-schedule infraction if the expiration has been updated
if 'expires_at' in request_data:
- self.infractions_cog.cancel_task(new_infraction['id'])
+ # A scheduled task should only exist if the old infraction wasn't permanent
+ if old_infraction['expires_at']:
+ self.infractions_cog.cancel_task(new_infraction['id'])
# If the infraction was not marked as permanent, schedule a new expiration task
if request_data['expires_at']: