aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2020-02-14 09:12:53 -0800
committerGravatar GitHub <[email protected]>2020-02-14 09:12:53 -0800
commit98a8df32c6f3851527593c879b2fc591dbf1c56f (patch)
tree369d595b9fb495e083b2c66825e7647f92a989e0
parentMerge pull request #747 from mosguinz/pagniation-fix (diff)
parentStop scheduling expiration of permanent infractions on edit (diff)
Merge pull request #752 from python-discord/infr-edit-permanent-fix
Stop scheduling expiration of permanent infractions on edit
-rw-r--r--bot/cogs/moderation/management.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index 0636422d3..f2964cd78 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -130,8 +130,11 @@ 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'])
- loop = asyncio.get_event_loop()
- self.infractions_cog.schedule_task(loop, new_infraction['id'], new_infraction)
+
+ # If the infraction was not marked as permanent, schedule a new expiration task
+ if request_data['expires_at']:
+ loop = asyncio.get_event_loop()
+ self.infractions_cog.schedule_task(loop, new_infraction['id'], new_infraction)
log_text += f"""
Previous expiry: {old_infraction['expires_at'] or "Permanent"}