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: catch a possible exception in beta course configuration #36172

Conversation

deborahgu
Copy link
Member

Description

when the learner is a beta tester, and the beta test has been set up with an extremely large duration, the courseware djangoapp can return an overflow error on a timedelta call. In those circumstances, this defaults to returning an unmodified date.

FIXES: APER-3848

when the learner is a beta tester, and the beta test has been set up with a large duration, the courseware djangoapp can return an overflow error on a timedelta call. In those circumstances, this defaults to returning an unmodified date.

FIXES: APER-3848
removing an unused import
@@ -93,7 +95,7 @@ def enterprise_learner_enrolled(request, user, course_key):
# enterprise_customer_data is either None (if learner is not linked to any customer) or a serialized
# EnterpriseCustomer representing the learner's active linked customer.
enterprise_customer_data = enterprise_customer_from_session_or_learner_data(request)
learner_portal_enabled = enterprise_customer_data and enterprise_customer_data['enable_learner_portal']
learner_portal_enabled = enterprise_customer_data and enterprise_customer_data["enable_learner_portal"]
Copy link
Member Author

@deborahgu deborahgu Jan 24, 2025

Choose a reason for hiding this comment

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

all of the changes in this file from this line down are just because I let my IDE autolint the file to our current standards. Usually I wouldn't commit an autoformat at the same time as an actual code change, but because the code change is just that one tiny block above, and the autoformat isn't extreme, it seemed like a legitimate choice. I can undo if reviewers prefer.

adjusted_date = adjust_start_date(user, days_early_for_beta, start, course_key)
self.assertEqual(expected, adjusted_date)


Copy link
Member Author

Choose a reason for hiding this comment

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

same as above – from here on down it is just autoformatting. Again, I can undo it and just put in the individual changes the reviewers think it is too excessive.

@deborahgu deborahgu requested a review from nsprenkle January 27, 2025 17:35
Copy link
Contributor

@nsprenkle nsprenkle left a comment

Choose a reason for hiding this comment

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

I haven't gotten to test this but the changes look good on my end :shipit:

@deborahgu deborahgu merged commit e7771d6 into master Jan 27, 2025
49 checks passed
@deborahgu deborahgu deleted the dkaplan1/APER-3848_improve-exception-handling-in-learner-home-init branch January 27, 2025 18:59
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

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