Skip to content

Commit

Permalink
Drop status column from media reports
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed Jul 1, 2024
1 parent b9b3f6f commit 8872977
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 4.2.11 on 2024-06-28 19:53

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0067_alter_audiodecisionthrough_media_obj_and_more'),
]

operations = [
migrations.RemoveField(
model_name='audioreport',
name='status',
),
migrations.RemoveField(
model_name='imagereport',
name='status',
),
]
13 changes: 0 additions & 13 deletions api/api/models/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,6 @@ class AbstractMediaReport(models.Model):

REPORT_CHOICES = [(MATURE, MATURE), (DMCA, DMCA), (OTHER, OTHER)]

STATUS_CHOICES = [
(PENDING, PENDING),
(MATURE_FILTERED, MATURE_FILTERED),
(DEINDEXED, DEINDEXED),
(NO_ACTION, NO_ACTION),
]

created_at = models.DateTimeField(auto_now_add=True)

media_obj = models.ForeignKey(
Expand Down Expand Up @@ -226,12 +219,6 @@ class AbstractMediaReport(models.Model):
null=True,
help_text="The explanation on why media is being reported.",
)
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default=PENDING)
"""
All statuses except ``PENDING`` are deprecated. Instead refer to the
property ``is_pending``.
"""

decision = models.ForeignKey(
to="AbstractMediaDecision",
on_delete=models.SET_NULL,
Expand Down
2 changes: 1 addition & 1 deletion api/latest_migrations/api
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# If you have a merge conflict in this file, it means you need to run:
# manage.py makemigrations --merge
# in order to resolve the conflict between migrations.
0067_alter_audiodecisionthrough_media_obj_and_more
0068_remove_audioreport_status_remove_imagereport_status
3 changes: 1 addition & 2 deletions api/test/unit/models/test_media_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
MATURE,
MATURE_FILTERED,
OTHER,
PENDING,
AbstractDeletedMedia,
AbstractSensitiveMedia,
)
Expand Down Expand Up @@ -41,7 +40,7 @@ def test_pending_reports_have_no_subreport_models(
media = media_type_config.model_factory.create()
report = media_type_config.report_factory.create(media_obj=media, reason=reason)

assert report.status == PENDING
assert report.decision is None
assert not media_type_config.sensitive_class.objects.filter(
media_obj=media
).exists()
Expand Down

0 comments on commit 8872977

Please sign in to comment.