Repository navigation
716 archived field cc group models #857
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
ormsbee
merged 6 commits into
openedx:main
from
ufedaseyeuconsultant:ufedaseyeu/716-archived-field-onto-upstream
Oct 12, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
93609c5
feat: add archived field to CompetencyCriteriaGroup and CompetencyCri…
ufedaseyeuconsultant e71d66d
test: cover archived field defaults on group and criterion (#716)
ufedaseyeuconsultant 4888a93
fix: renumber #716's migration onto upstream's current tip
ufedaseyeuconsultant ae5a420
test: drop two docstrings that just restate the test name
ufedaseyeuconsultant a684d66
fix: renumber #716's migration past upstream's new 0013
ufedaseyeuconsultant ff82889
fix: describe archived in terms of the row, not one future consumer
ufedaseyeuconsultant 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
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 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -96,6 +96,14 @@ class CompetencyCriteriaGroup(models.Model): | |||||||||||||||||||||||||
| "logic is moot; the application layer treats null the same as OR." | ||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| archived = models.BooleanField( | ||||||||||||||||||||||||||
| default=False, | ||||||||||||||||||||||||||
| help_text=_( | ||||||||||||||||||||||||||
| "Set instead of deleting this group once learner status exists for it or anything beneath " | ||||||||||||||||||||||||||
| "it. Hides the group from authoring and new associations while keeping it queryable, so its " | ||||||||||||||||||||||||||
| "criteria and existing learner status rows stay resolvable." | ||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| history = HistoricalRecords() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -307,6 +315,14 @@ class CompetencyCriterion(models.Model): | |||||||||||||||||||||||||
| null=True, blank=True, | ||||||||||||||||||||||||||
| help_text=_("Overrides rule_profile's rule_payload for this criterion. Set only when rule_profile is null."), | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
| archived = models.BooleanField( | ||||||||||||||||||||||||||
| default=False, | ||||||||||||||||||||||||||
| help_text=_( | ||||||||||||||||||||||||||
| "Set instead of deleting this criterion once learner status exists for it. Hides the " | ||||||||||||||||||||||||||
| "criterion from authoring and new associations while keeping it queryable, so existing " | ||||||||||||||||||||||||||
| "learner status rows stay resolvable." | ||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
Comment on lines
+318
to
+325
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise here. Maybe:
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| history = HistoricalRecords() | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
48 changes: 48 additions & 0 deletions
48
src/openedx_learning/migrations/0014_add_archived_to_criteria_group_and_criterion.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,48 @@ | ||
| # Generated by Django 5.2.17 on 2026-10-12 14:50 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ( | ||
| "openedx_learning", | ||
| "0013_alter_historicalcompetencycriteriagroup_history_date_and_more", | ||
| ), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="competencycriteriagroup", | ||
| name="archived", | ||
| field=models.BooleanField( | ||
| default=False, | ||
| help_text="Set instead of deleting this group once learner status exists for it or anything beneath it. Hides the group from authoring and new associations while keeping it queryable, so its criteria and existing learner status rows stay resolvable.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="competencycriterion", | ||
| name="archived", | ||
| field=models.BooleanField( | ||
| default=False, | ||
| help_text="Set instead of deleting this criterion once learner status exists for it. Hides the criterion from authoring and new associations while keeping it queryable, so existing learner status rows stay resolvable.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="historicalcompetencycriteriagroup", | ||
| name="archived", | ||
| field=models.BooleanField( | ||
| default=False, | ||
| help_text="Set instead of deleting this group once learner status exists for it or anything beneath it. Hides the group from authoring and new associations while keeping it queryable, so its criteria and existing learner status rows stay resolvable.", | ||
| ), | ||
| ), | ||
| migrations.AddField( | ||
| model_name="historicalcompetencycriterion", | ||
| name="archived", | ||
| field=models.BooleanField( | ||
| default=False, | ||
| help_text="Set instead of deleting this criterion once learner status exists for it. Hides the criterion from authoring and new associations while keeping it queryable, so existing learner status rows stay resolvable.", | ||
| ), | ||
| ), | ||
| ] |
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
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.
Please describe what the flag means for the row rather than what one endpoint does with it. The "criteria-tree read endpoint" is #681, which doesn't exist yet, and it's one consumer among several: #674 and #675 are what set this, and #847's
create_leaf_group()is going to have to care about it too. ADR-0002 Decision 2 already has the words, andCompetencyRuleProfile.archivedbelow uses them. Maybe something like:Django bakes
help_textinto the migration, so 0014 needs regenerating after this. FYI @tbain: the same note applies to thearchivedfields in #856.