aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-03-07 16:42:16 -0800
committerGravatar MarkKoz <[email protected]>2020-03-07 16:42:16 -0800
commite7dde8f29212b21edf241b2d821e7c40a282b5d8 (patch)
tree122656c47882094db975f0032aa1fa50b70cf5f6
parentMerge pull request #820 from python-discord/feat/ci/pre-commit-tweaks (diff)
ModLog: fix posting null attachments for deleted message logs
If attachments are not given to `upload_log`, an empty list is used. By default, `zip_longest` uses `None` ass the fill value, so each message was getting paired with a `None` (AKA null) attachment. The filed in the DB is non-nullable so an empty list must be used instead. Fixes #792
-rw-r--r--bot/cogs/moderation/modlog.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index 59ae6b587..81d95298d 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -67,7 +67,7 @@ class ModLog(Cog, name="ModLog"):
'embeds': [embed.to_dict() for embed in message.embeds],
'attachments': attachment,
}
- for message, attachment in zip_longest(messages, attachments)
+ for message, attachment in zip_longest(messages, attachments, fillvalue=[])
]
}
)