aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar S. Co1 <[email protected]>2020-03-31 14:55:18 -0400
committerGravatar GitHub <[email protected]>2020-03-31 14:55:18 -0400
commitebd98156dad57ea2623aa8faa0005c7ffde3e712 (patch)
treecec932103518103d6202725fdfb96fa6f0a52f25
parentMerge pull request #854 from ks129/tags-trashcan-react (diff)
parentMerge branch 'master' into infraction-edit (diff)
Merge pull request #852 from ks129/infraction-edit
Don't let change expiration time when infraction already expired.
Diffstat (limited to '')
-rw-r--r--bot/cogs/moderation/management.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index 35448f682..250a24247 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -100,7 +100,12 @@ class ModManagement(commands.Cog):
confirm_messages = []
log_text = ""
- if isinstance(duration, str):
+ if duration is not None and not old_infraction['active']:
+ if reason is None:
+ await ctx.send(":x: Cannot edit the expiration of an expired infraction.")
+ return
+ 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: