Add report cooldowns
This is to prevent report flooding/spamming. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -55,6 +55,9 @@ class Board(models.Model):
|
||||
# The amount of time that users from the same IP address are allowed to make
|
||||
# consecutive posts
|
||||
post_cooldown = models.DurationField(default=timedelta(seconds=60))
|
||||
# The amount of time that users from the same IP address are allowed to make
|
||||
# consecutive reports
|
||||
report_cooldown = models.DurationField(default=timedelta(seconds=15))
|
||||
# Auto-sink threshhold. This is the number of replies that a thread can have
|
||||
# before it stops being bumped.
|
||||
autosink = models.IntegerField(default=300)
|
||||
@@ -292,6 +295,8 @@ class Report(models.Model):
|
||||
reason = models.ForeignKey("ReportReason", on_delete=models.CASCADE)
|
||||
# IP address of the reporter
|
||||
ip = models.GenericIPAddressField()
|
||||
# Time that this report was created
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
|
||||
@receiver(signals.post_save, sender=Report)
|
||||
|
||||
Reference in New Issue
Block a user