Skip to content
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: do not push runs without seats to ecommerce in data loader #4474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zawan-ila
Copy link
Contributor

PROD-4171

In the courses data loader, we push to ecommerce if the run has an updated end date. This is primarily to push seat upgrade deadline changes (which depend on run end date) to ecommerce. However, in case a run is newly created and has no seats so far, a push to ecommerce will convince ecommerce that the run does not have any seats. Hence, even if we add seats to the draft version of the run, the Ecommerce Data loader might delete the seats from discovery if the seats have not been pushed to the non-draft version and ecommerce before the time that the ecomm loader runs.

This PR attempts to circumvent the above issue by only pushing a run to ecommerce in the courses data loader if it has a non-zero number of associated seats.

runs = CourseRun.objects.all()

run = runs[0]
run.end = datetime.datetime.now(pytz.UTC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is end date set to now here? Where are we checking the seat non-existence here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants