mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 10:00:33 +00:00
Adds model for creating automated moderation flags
This commit is contained in:
parent
20df7cbdd6
commit
c8b4d5ecf1
2 changed files with 34 additions and 0 deletions
26
bookwyrm/migrations/0138_autoflag.py
Normal file
26
bookwyrm/migrations/0138_autoflag.py
Normal 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)),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue