-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new SensitiveMedia and MediaReport models
Signed-off-by: Olga Bulat <[email protected]>
- Loading branch information
Showing
16 changed files
with
539 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
api/api/migrations/0055_rename_imagereport_nsfwreport_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.2.7 on 2023-12-11 04:49 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("api", "0054_throttledapplication_post_logout_redirect_uris"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name="ImageReport", | ||
new_name="NsfwReport", | ||
), | ||
migrations.RenameModel( | ||
old_name="AudioReport", | ||
new_name="NsfwReportAudio", | ||
), | ||
] |
271 changes: 271 additions & 0 deletions
271
api/api/migrations/0056_sensitiveaudio_sensitiveimage_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,271 @@ | ||
# Generated by Django 4.2.7 on 2023-12-11 06:32 | ||
|
||
import api.models.media | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("api", "0055_rename_imagereport_nsfwreport_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SensitiveAudio", | ||
fields=[ | ||
("created_on", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"media_obj", | ||
models.OneToOneField( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the sensitive audio.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
primary_key=True, | ||
related_name="sensitive_audio", | ||
serialize=False, | ||
to="api.audio", | ||
to_field="identifier", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name_plural": "Sensitive audio", | ||
}, | ||
bases=(api.models.media.PerformIndexUpdateMixin, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name="SensitiveImage", | ||
fields=[ | ||
("created_on", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"media_obj", | ||
models.OneToOneField( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the sensitive image.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
primary_key=True, | ||
related_name="sensitive_image", | ||
serialize=False, | ||
to="api.image", | ||
to_field="identifier", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=(api.models.media.PerformIndexUpdateMixin, models.Model), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreport", | ||
name="media_obj", | ||
field=models.ForeignKey( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the image being reported.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="nsfw_image_report", | ||
to="api.image", | ||
to_field="identifier", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreport", | ||
name="reason", | ||
field=models.CharField( | ||
choices=[ | ||
("sensitive", "sensitive"), | ||
("dmca", "dmca"), | ||
("other", "other"), | ||
], | ||
help_text="The reason to report media to Openverse.", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreport", | ||
name="status", | ||
field=models.CharField( | ||
choices=[ | ||
("pending_review", "pending_review"), | ||
("sensitive_filtered", "sensitive_filtered"), | ||
("deindexed", "deindexed"), | ||
("no_action", "no_action"), | ||
], | ||
default="pending_review", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreportaudio", | ||
name="media_obj", | ||
field=models.ForeignKey( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the audio being reported.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="nsfw_audio_report", | ||
to="api.audio", | ||
to_field="identifier", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreportaudio", | ||
name="reason", | ||
field=models.CharField( | ||
choices=[ | ||
("sensitive", "sensitive"), | ||
("dmca", "dmca"), | ||
("other", "other"), | ||
], | ||
help_text="The reason to report media to Openverse.", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="nsfwreportaudio", | ||
name="status", | ||
field=models.CharField( | ||
choices=[ | ||
("pending_review", "pending_review"), | ||
("sensitive_filtered", "sensitive_filtered"), | ||
("deindexed", "deindexed"), | ||
("no_action", "no_action"), | ||
], | ||
default="pending_review", | ||
max_length=20, | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="ImageReport", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"reason", | ||
models.CharField( | ||
choices=[ | ||
("sensitive", "sensitive"), | ||
("dmca", "dmca"), | ||
("other", "other"), | ||
], | ||
help_text="The reason to report media to Openverse.", | ||
max_length=20, | ||
), | ||
), | ||
( | ||
"description", | ||
models.TextField( | ||
blank=True, | ||
help_text="The explanation on why media is being reported.", | ||
max_length=500, | ||
null=True, | ||
), | ||
), | ||
( | ||
"status", | ||
models.CharField( | ||
choices=[ | ||
("pending_review", "pending_review"), | ||
("sensitive_filtered", "sensitive_filtered"), | ||
("deindexed", "deindexed"), | ||
("no_action", "no_action"), | ||
], | ||
default="pending_review", | ||
max_length=20, | ||
), | ||
), | ||
( | ||
"media_obj", | ||
models.ForeignKey( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the image being reported.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="image_report", | ||
to="api.image", | ||
to_field="identifier", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="AudioReport", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
( | ||
"reason", | ||
models.CharField( | ||
choices=[ | ||
("sensitive", "sensitive"), | ||
("dmca", "dmca"), | ||
("other", "other"), | ||
], | ||
help_text="The reason to report media to Openverse.", | ||
max_length=20, | ||
), | ||
), | ||
( | ||
"description", | ||
models.TextField( | ||
blank=True, | ||
help_text="The explanation on why media is being reported.", | ||
max_length=500, | ||
null=True, | ||
), | ||
), | ||
( | ||
"status", | ||
models.CharField( | ||
choices=[ | ||
("pending_review", "pending_review"), | ||
("sensitive_filtered", "sensitive_filtered"), | ||
("deindexed", "deindexed"), | ||
("no_action", "no_action"), | ||
], | ||
default="pending_review", | ||
max_length=20, | ||
), | ||
), | ||
( | ||
"media_obj", | ||
models.ForeignKey( | ||
db_column="identifier", | ||
db_constraint=False, | ||
help_text="The reference to the audio being reported.", | ||
on_delete=django.db.models.deletion.DO_NOTHING, | ||
related_name="audio_report", | ||
to="api.audio", | ||
to_field="identifier", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.