aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Karlis S <[email protected]>2020-03-29 19:27:34 +0300
committerGravatar GitHub <[email protected]>2020-03-29 19:27:34 +0300
commit5d24f9a487a2d5c731a865e3ed808db6157951ea (patch)
treef6ada606d627cba2386a0f83e9c43a7025c0bfae
parentMerge pull request #849 from ks129/webhook-match (diff)
(Infraction Edit): Don't let change expiration when infraction already expired.
-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 35448f682..531bb1743 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -100,7 +100,9 @@ class ModManagement(commands.Cog):
confirm_messages = []
log_text = ""
- if isinstance(duration, str):
+ if duration is not None and not old_infraction['active']:
+ confirm_messages.append("expiry unchanged (infraction already expired)")
+ elif isinstance(duration, str):
request_data['expires_at'] = None
confirm_messages.append("marked as permanent")
elif duration is not None: