Storing deleted messages fails because of "not null" constraint #324
Labels
area: API
Related to or causes API changes
priority: 0 - critical
Needs to be addressed ASAP
type: bug
Something isn't working
Currently, some of our moderation tools fail because our database rejects messages without a value for the attachment field. The issue is caused by the fact that
null=True
is not set for this field, while we do not always provide a value:site/pydis_site/apps/api/models/bot/message.py
Lines 54 to 60 in 824566b
(Note that
blank=True
means that the field won't be required in form validation, but it does not mean the field can be blank in the database.)This bug is critical as it causes some of our moderation tools to fail halfway through their execution; most notably, when our anti-spam feature issues a mute, it will mute the user but not alert moderators. Since there are quite a few false positives, we rely heavily on those alerts to inspect the trigger. The bug also means the deleted messages are not retained for inspection.
Full traceback:
The text was updated successfully, but these errors were encountered: