Make reports

This commit is contained in:
Mouse Reeve
2021-03-08 18:36:34 -08:00
parent e59c127686
commit 21f199c548
12 changed files with 96 additions and 19 deletions

View File

@ -1,9 +1,10 @@
# Generated by Django 3.0.7 on 2021-03-09 00:55
# Generated by Django 3.0.7 on 2021-03-09 01:56
import bookwyrm.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.expressions
class Migration(migrations.Migration):
@ -23,12 +24,9 @@ class Migration(migrations.Migration):
('note', models.TextField(blank=True, null=True)),
('resolved', models.BooleanField(default=False)),
('reporter', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reporter', to=settings.AUTH_USER_MODEL)),
('statuses', models.ManyToManyField(to='bookwyrm.Status')),
('statuses', models.ManyToManyField(blank=True, null=True, to='bookwyrm.Status')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='ReportComment',
@ -45,4 +43,8 @@ class Migration(migrations.Migration):
'abstract': False,
},
),
migrations.AddConstraint(
model_name='report',
constraint=models.CheckConstraint(check=models.Q(_negated=True, reporter=django.db.models.expressions.F('user')), name='self_report'),
),
]