-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix: CSV loader reverting future runs to in LegalReview #4508
Conversation
d707883
to
35cbf14
Compare
b757c64
to
2dec561
Compare
# url slug is correctly generated in subdirectory format | ||
course_run.status = CourseRunStatus.LegalReview | ||
course_run.save(update_fields=['status'], send_emails=False) | ||
course_run.refresh_from_db() |
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.
Moved this refresh_from_db()
above to get the updated status and complete the review cycle in one go
course_run = CourseRun.everything.get(course=course, draft=True) | ||
|
||
self._assert_course_data(course, {**self.BASE_EXPECTED_COURSE_DATA}) | ||
assert course_run.status == CourseRunStatus.Reviewed |
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: why is the status reviewed and not published? I don't see any dates data to assert this is a future variant.
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.
It's because of this _complete_run_review which is calling complete_review_phase which is moving the course_run to reviewed Status. However code changes works fine, we can add a refresh_from_db
call after the _complete_run_review
statement to refresh the course_run status.
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.
🤦🏻 Figured out the issue, go_live_date
is empty for the run because the run is in the review_in_legal state
, so the course_run data doesn't get updated—only the status changes. In the subsequent run, the course_run data will be updated.
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.
Now, the code is written in such a way that it ends up moving the course to the review_by_legal status when the command is completed
3c424e9
to
467276c
Compare
PROD-4243
This PR fixes an issue in the CSV loader where future runs were being reverted to the LegalReview state.
We have added a check in the CSV loader to complete the review cycle if a course run is in LegalReview.
Previously, changing the enrollment_end date moved the run to the LegalReview state as it is a non-exempt field. To address this behavior, we have added the above condition