Closed pt2302 closed 4 days ago
I thought maybe https://github.com/mitodl/mitxonline/pull/2367 would have fixed this?
FYI, Anyone who works on this ticket. I was randomly looking at this ticket but it caught my interest. Here are some details I figured out as to why this might be happening.
Our missing migration detection script ./scripts/test/detect_missing_migrations.sh
in CI is complaining about a missing migration e.g. Migrations for 'courses': courses/migrations/0055_alter_program_availability.py - Alter field availability on program
.
[TEST SUITE] ./scripts/test/detect_missing_migrations.sh
Error: one or more migrations are missing
Migrations for 'courses': courses/migrations/0055_alter_program_availability.py - Alter field availability on program
[TEST SUITE] ./scripts/test/no_auto_migrations.sh
I also looked at the code and there were no new changes in the models after we added the availability field in https://github.com/mitodl/mitxonline/pull/2322.
So why is this migration being generated even without any model changes?
I think the problem propagated like this:
AVAILABILITY_CHOICES
is a constant AVAILABILITY_CHOICES = list(zip(AVAILABILITY_TYPES, AVAILABILITY_TYPES))anytime
and dated
with different orders.Potential Solution:
We should use the list in https://github.com/mitodl/mitxonline/blob/main/courses/constants.py#L37 instead of a set.
Expected Behavior
Python tests should be passing.
Current Behavior
Python tests are failing with this error:
/home/runner/work/mitxonline/mitxonline/frontend/staff-dashboard/build System check identified some issues: WARNINGS: ?: (urls.W005) URL namespace 'v1' isn't unique. You may not be able to reverse all URLs in this namespace cms.CoursePage.topics: (fields.W340) null has no effect on ManyToManyField. Migrations for 'courses': courses/migrations/0055_alter_program_availability.py - Alter field availability on program
Just attempting to apply migrations does not resolve this issue.