-
-
Notifications
You must be signed in to change notification settings - Fork 301
Add action to resolve Community Library Submissions #5178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexVelezLl
merged 7 commits into
learningequality:community-channels
from
Jakoma02:resolve_submission_action
Jul 28, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
53c119f
Add action to resolve Community Library Submissions
Jakoma02 c6d2207
Allow resolution reason to be blank
Jakoma02 9cddb63
Address PR feedback
Jakoma02 ff53d60
Use the same case for both community library routes
Jakoma02 73ad4cb
Do not pass pk explicitly to serialize_object
Jakoma02 72bbef6
Move community library filtering and pagination to mixin
Jakoma02 7a3c46e
Remove leftover migration
Jakoma02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
contentcuration/contentcuration/constants/community_library_submission.py
This file contains hidden or 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 |
|---|---|---|
| @@ -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"), | ||
| ) |
75 changes: 75 additions & 0 deletions
75
contentcuration/contentcuration/migrations/0156_communitylibrarysubmission_admin_fields.py
This file contains hidden or 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,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, | ||
| ), | ||
| ), | ||
| ] |
29 changes: 29 additions & 0 deletions
29
...ion/contentcuration/migrations/0157_alter_communitylibrarysubmission_resolution_reason.py
This file contains hidden or 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,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 = [ | ||
| 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, | ||
| ), | ||
| ), | ||
| ] | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
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 😅