Adds model for creating automated moderation flags

This commit is contained in:
Mouse Reeve 2022-02-17 21:01:34 -08:00
parent 20df7cbdd6
commit c8b4d5ecf1
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,26 @@
# Generated by Django 3.2.12 on 2022-02-18 04:53
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bookwyrm', '0137_alter_sitesettings_allow_registration'),
]
operations = [
migrations.CreateModel(
name='AutoFlag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('flag_users', models.BooleanField(default=False)),
('flag_statuses', models.BooleanField(default=False)),
('string_match', models.CharField(max_length=200)),
('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
),
]

View file

@ -33,3 +33,11 @@ class IPBlocklist(models.Model):
"""default sorting"""
ordering = ("-created_date",)
class AutoFlag(models.Model):
"""rules to automatically flag suspicious activity"""
created_by = models.ForeignKey("User", on_delete=models.PROTECT)
flag_users = models.BooleanField(default=False)
flag_statuses = models.BooleanField(default=False)
string_match = models.CharField(max_length=200)