Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
STATUS_PENDING = "PENDING"
STATUS_APPROVED = "APPROVED"
STATUS_REJECTED = "REJECTED"
STATUS_SUPERSEDED = "SUPERSEDED"
STATUS_LIVE = "LIVE"

status_choices = (
(STATUS_PENDING, "Pending"),
(STATUS_APPROVED, "Approved"),
(STATUS_REJECTED, "Rejected"),
(STATUS_SUPERSEDED, "Superseded"),
(STATUS_LIVE, "Live"),
)

REASON_INVALID_LICENSING = "INVALID_LICENSING"
REASON_TECHNICAL_QUALITY_ASSURANCE = "TECHNICAL_QUALITY_ASSURANCE"
REASON_INVALID_METADATA = "INVALID_METADATA"
REASON_PORTABILITY_ISSUES = "PORTABILITY_ISSUES"
REASON_OTHER = "OTHER"

resolution_reason_choices = (
(REASON_INVALID_LICENSING, "Invalid Licensing"),
(REASON_TECHNICAL_QUALITY_ASSURANCE, "Technical Quality Assurance"),
(REASON_INVALID_METADATA, "Invalid Metadata"),
(REASON_PORTABILITY_ISSUES, "Portability Issues"),
(REASON_OTHER, "Other"),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Generated by Django 3.2.24 on 2025-07-15 19:12
import django.db.models.deletion
from django.conf import settings
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
(
"contentcuration",
"0155_communitylibrarysubmission_submission_date_created_idx",
),
]

operations = [
migrations.AddField(
model_name="communitylibrarysubmission",
name="date_resolved",
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name="communitylibrarysubmission",
name="feedback_notes",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="communitylibrarysubmission",
name="internal_notes",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="communitylibrarysubmission",
name="resolution_reason",
field=models.CharField(
blank=True,
choices=[
("INVALID_LICENSING", "Invalid Licensing"),
("TECHNICAL_QUALITY_ASSURANCE", "Technical Quality Assurance"),
("INVALID_METADATA", "Invalid Metadata"),
("PORTABILITY_ISSUES", "Portability Issues"),
("OTHER", "Other"),
],
max_length=50,
null=True,
),
),
migrations.AddField(
model_name="communitylibrarysubmission",
name="resolved_by",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="resolved_community_library_submissions",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="communitylibrarysubmission",
name="status",
field=models.CharField(
choices=[
("PENDING", "Pending"),
("APPROVED", "Approved"),
("REJECTED", "Rejected"),
("SUPERSEDED", "Superseded"),
("LIVE", "Live"),
],
default="PENDING",
max_length=20,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 3.2.24 on 2025-07-15 20:11
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
("contentcuration", "0156_communitylibrarysubmission_admin_fields"),
]

operations = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can collapse this migration with the previous one, as I see the only value that is being altered is the `blank=True)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are, of course, right. I incorrectly thought the previous migration was created in an earlier PR, so it was necessary to alter it. It definitely does not make sense to create and alter the field in the same PR. I fixed this in 9cddb63.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we still need to remove this file, as its not needed anymore 😅

migrations.AlterField(
model_name="communitylibrarysubmission",
name="resolution_reason",
field=models.CharField(
blank=True,
choices=[
("INVALID_LICENSING", "Invalid Licensing"),
("TECHNICAL_QUALITY_ASSURANCE", "Technical Quality Assurance"),
("INVALID_METADATA", "Invalid Metadata"),
("PORTABILITY_ISSUES", "Portability Issues"),
("OTHER", "Other"),
],
max_length=50,
null=True,
),
),
]
16 changes: 16 additions & 0 deletions contentcuration/contentcuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2558,11 +2558,27 @@ class CommunityLibrarySubmission(models.Model):
)
categories = models.JSONField(blank=True, null=True)
date_created = models.DateTimeField(auto_now_add=True)
date_resolved = models.DateTimeField(blank=True, null=True)
status = models.CharField(
max_length=20,
choices=community_library_submission.status_choices,
default=community_library_submission.STATUS_PENDING,
)
resolved_by = models.ForeignKey(
User,
related_name="resolved_community_library_submissions",
blank=True,
null=True,
on_delete=models.SET_NULL,
)
resolution_reason = models.CharField(
max_length=50,
choices=community_library_submission.resolution_reason_choices,
blank=True,
null=True,
)
feedback_notes = models.TextField(blank=True, null=True)
internal_notes = models.TextField(blank=True, null=True)

def save(self, *args, **kwargs):
# Validate on save that the submission author is an editor of the channel
Expand Down
Loading