mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

mitxonline dashboard crashes when courserun has no upgrade deadline #2362

Closed cp-at-mit closed 2 weeks ago

cp-at-mit commented 2 weeks ago

What are the relevant tickets?

https://github.com/mitodl/hq/issues/5284

Description (What does it do?)

mitxonline dashboard crashes when courserun has no upgrade deadline

How can this be tested?

  1. Create a course run with no upgrade deadline defined and course run enrollment for that course run.
  2. Visit the dashboard and verify that the page loads correctly.
  3. Update the course run to have an upgrade deadline in the future.
  4. Visit the dashboard and verify that the page loads correctly.
annagav commented 2 weeks ago

@cp-at-mit I think this might be a related issue https://github.com/mitodl/mitxonline/issues/2137. Does this PR fix this issue?

cp-at-mit commented 2 weeks ago

@cp-at-mit I think this might be a related issue #2137. Does this PR fix this issue?

Yeah it sounds like this would resolve that requirement

cp-at-mit commented 2 weeks ago

I think this PR should make "upgrade deadline" be required field on the CourseRun model.

@annagav What date should the migration use for CourseRuns without an upgrade deadline?

annagav commented 2 weeks ago

@cp-at-mit are there there many course runs in production that are missing it? What type of courses are those?

cp-at-mit commented 2 weeks ago

@cp-at-mit are there there many course runs in production that are missing it? What type of courses are those?

I think I saw 8 courses without an upgrade deadline. I think they are just normal courses.

annagav commented 2 weeks ago

So all the upgrade_deadline does is that it prevents a user from enrolling in verified more after the deadline. So if there is no deadline I am assuming no verified mode is available for the course. So we can set the missing upgrade deadline values to any date in the past or now.

pdpinch commented 2 weeks ago

I think this PR should make "upgrade deadline" be required field on the CourseRun model.

While our current business rule is that all courses should offer certificates or sale and therefore have an upgrade deadline, I'm reluctant to add a validation for this.

Where would it be applied? How will it complicate the course configuration process, which is already quite messy? What do we do if the upgrade deadline hasn't been determined at the time of courserun creation? And does it tie our hands for offering new types of courses in the future, like SPOCs (small private courses) or other courses without certificates?