Skip to content

Commit da5fb15

Browse files
Community Library Notifications Filtering (#5566)
* Community Library Notifications Filtering * [pre-commit.ci lite] apply automatic fixes * fix linting * fix code * [pre-commit.ci lite] apply automatic fixes * fix linting * fix code * fix code * [pre-commit.ci lite] apply automatic fixes * fix code * fix code * fix code * [pre-commit.ci lite] apply automatic fixes * fix code * [pre-commit.ci lite] apply automatic fixes * merge two migrations --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 78f03fc commit da5fb15

File tree

4 files changed

+423
-37
lines changed

4 files changed

+423
-37
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 3.2.24 on 2025-11-30 23:27
2+
from django.db import migrations
3+
from django.db import models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("contentcuration", "0158_add_audited_special_permissions_license"),
10+
]
11+
12+
operations = [
13+
migrations.RemoveIndex(
14+
model_name="communitylibrarysubmission",
15+
name="submission_date_created_idx",
16+
),
17+
migrations.RenameField(
18+
model_name="communitylibrarysubmission",
19+
old_name="date_resolved",
20+
new_name="date_updated",
21+
),
22+
migrations.AlterField(
23+
model_name="communitylibrarysubmission",
24+
name="date_updated",
25+
field=models.DateTimeField(auto_now=True, db_index=True),
26+
),
27+
migrations.AlterField(
28+
model_name="communitylibrarysubmission",
29+
name="status",
30+
field=models.CharField(
31+
choices=[
32+
("PENDING", "Pending"),
33+
("APPROVED", "Approved"),
34+
("REJECTED", "Rejected"),
35+
("SUPERSEDED", "Superseded"),
36+
("LIVE", "Live"),
37+
],
38+
db_index=True,
39+
default="PENDING",
40+
max_length=20,
41+
),
42+
),
43+
]

contentcuration/contentcuration/models.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,11 +2594,12 @@ class CommunityLibrarySubmission(models.Model):
25942594
)
25952595
categories = models.JSONField(blank=True, null=True)
25962596
date_created = models.DateTimeField(auto_now_add=True)
2597-
date_resolved = models.DateTimeField(blank=True, null=True)
2597+
date_updated = models.DateTimeField(auto_now=True, db_index=True)
25982598
status = models.CharField(
25992599
max_length=20,
26002600
choices=community_library_submission.status_choices,
26012601
default=community_library_submission.STATUS_PENDING,
2602+
db_index=True,
26022603
)
26032604
resolved_by = models.ForeignKey(
26042605
User,
@@ -2702,10 +2703,6 @@ class Meta:
27022703
name="unique_channel_with_channel_version",
27032704
),
27042705
]
2705-
indexes = [
2706-
# Useful for cursor pagination
2707-
models.Index(fields=["-date_created"], name="submission_date_created_idx"),
2708-
]
27092706

27102707

27112708
class AuditedSpecialPermissionsLicense(models.Model):

0 commit comments

Comments
 (0)