summaryrefslogtreecommitdiffstats
path: root/users/migrations
diff options
context:
space:
mode:
authorAndrew Godwin2022-12-17 14:45:31 -0700
committerAndrew Godwin2022-12-17 14:45:31 -0700
commite8d6dccbb27a8611311b5f94f593b69bcca99528 (patch)
tree440901d8495f29e682d5fd08bb3ee4e44e983505 /users/migrations
parentb3b2c6effdd747db9076b3139963965f4718eee9 (diff)
downloadtakahe-e8d6dccbb27a8611311b5f94f593b69bcca99528.tar.gz
takahe-e8d6dccbb27a8611311b5f94f593b69bcca99528.tar.bz2
takahe-e8d6dccbb27a8611311b5f94f593b69bcca99528.zip
Report function and admin
Diffstat (limited to 'users/migrations')
-rw-r--r--users/migrations/0005_report.py119
1 files changed, 119 insertions, 0 deletions
diff --git a/users/migrations/0005_report.py b/users/migrations/0005_report.py
new file mode 100644
index 0000000..a4556b2
--- /dev/null
+++ b/users/migrations/0005_report.py
@@ -0,0 +1,119 @@
+# Generated by Django 4.1.4 on 2022-12-17 20:38
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+import stator.models
+import users.models.report
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("activities", "0004_emoji_post_emojis"),
+ ("users", "0004_identity_admin_notes_identity_restriction_and_more"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="Report",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("state_ready", models.BooleanField(default=True)),
+ ("state_changed", models.DateTimeField(auto_now_add=True)),
+ ("state_attempted", models.DateTimeField(blank=True, null=True)),
+ ("state_locked_until", models.DateTimeField(blank=True, null=True)),
+ (
+ "state",
+ stator.models.StateField(
+ choices=[("new", "new"), ("sent", "sent")],
+ default="new",
+ graph=users.models.report.ReportStates,
+ max_length=100,
+ ),
+ ),
+ (
+ "type",
+ models.CharField(
+ choices=[
+ ("spam", "Spam"),
+ ("hateful", "Hateful"),
+ ("illegal", "Illegal"),
+ ("remote", "Remote"),
+ ("other", "Other"),
+ ],
+ max_length=100,
+ ),
+ ),
+ ("complaint", models.TextField()),
+ ("forward", models.BooleanField(default=False)),
+ ("valid", models.BooleanField(null=True)),
+ ("seen", models.DateTimeField(blank=True, null=True)),
+ ("resolved", models.DateTimeField(blank=True, null=True)),
+ ("notes", models.TextField(blank=True, null=True)),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ (
+ "moderator",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="moderated_reports",
+ to="users.identity",
+ ),
+ ),
+ (
+ "source_domain",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="filed_reports",
+ to="users.domain",
+ ),
+ ),
+ (
+ "source_identity",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="filed_reports",
+ to="users.identity",
+ ),
+ ),
+ (
+ "subject_identity",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="reports",
+ to="users.identity",
+ ),
+ ),
+ (
+ "subject_post",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="reports",
+ to="activities.post",
+ ),
+ ),
+ ],
+ options={
+ "abstract": False,
+ },
+ ),
+ ]