Repository navigation
fix: match openedx-platform's SIMPLE_HISTORY_DATE_INDEX in test settings #853
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
Changes from all commits
8940da5
e77bb82
d87b203
f42e6b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Generated by Django 5.2.17 on 2026-10-09 16:49 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("openedx_learning", "0012_studentcompetencycriteriagroupstatus"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name="historicalcompetencycriteriagroup", | ||
| name="history_date", | ||
| field=models.DateTimeField(), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="historicalcompetencycriterion", | ||
| name="history_date", | ||
| field=models.DateTimeField(), | ||
| ), | ||
| migrations.AlterField( | ||
| model_name="historicalcompetencyruleprofile", | ||
| name="history_date", | ||
| field=models.DateTimeField(), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,3 +127,11 @@ def root(*args): | |
| "django.contrib.auth.middleware.AuthenticationMiddleware", | ||
| "django.contrib.messages.middleware.MessageMiddleware", | ||
| ] | ||
|
|
||
| # django-simple-history bakes this setting into the history_date field of every | ||
| # HistoricalRecords() model, and therefore into any migration we generate for one. | ||
| # openedx-platform has had this set to False since its 2023 django-simple-history | ||
| # upgrade (openedx/openedx-platform#32880), to avoid adding an index to every | ||
| # historical table in the platform at once. Our migrations run there, so this has | ||
| # to match. | ||
| SIMPLE_HISTORY_DATE_INDEX = False | ||
|
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. Please add this to
Contributor
Author
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. done |
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Nit: This is the right fix, but it bothers me a little that openedx-platform's import-linter had to be the one to catch it. Our
.importlinteronly layers the top-level packages and says nothing about which modules ofopenedx_catalogthe layers above may reach into, which is the whole reasonmodels_api.pyexists. We should add the equivalent of openedx-platform'sisolated_appscontract (pyproject.toml, the one withallowed_modules = ["api", "models_api", "data", "tests"]) on the openedx-core side, so the next one of these fails here instead.Not required to merge, but I would appreciate it if you could add it here or to a follow-up PR.
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.
Thinking on this more, the contract stuff should definitely be a follow-up PR, so we unblock the upgrade as soon as possible. Thank you.
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.
Will be changed in the follow-up PR