From 9ac6157ba2b9f86598eede69df7b67fa320f95b2 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 18 Nov 2018 21:13:47 +0100 Subject: Add the `MessageDeletionContext` model. --- api/models.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'api/models.py') diff --git a/api/models.py b/api/models.py index 3ba0ac5c..bb3489d0 100644 --- a/api/models.py +++ b/api/models.py @@ -241,6 +241,25 @@ class Message(ModelReprMixin, models.Model): abstract = True +class MessageDeletionContext(ModelReprMixin, models.Model): + actor = models.ForeignKey( + Member, + on_delete=models.CASCADE, + help_text=( + "The original actor causing this deletion. Could be the author " + "of a manual clean command invocation, the bot when executing " + "automatic actions, or nothing to indicate that the bulk " + "deletion was not issued by us." + ), + null=True + ) + creation = models.DateTimeField( + # Consider whether we want to add a validator here that ensures + # the deletion context does not take place in the future. + help_text="When this deletion took place." + ) + + class Tag(ModelReprMixin, models.Model): """A tag providing (hopefully) useful information.""" -- cgit v1.2.3