-
Notifications
You must be signed in to change notification settings - Fork 3
fix: handle CourseOverview.DoesNotExist exception in optout creation #77
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
base: release-ulmo
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds exception handling to prevent user retirement failures when CourseOverview records are missing for enrollments. The fix wraps the optout creation logic in a try-except block to catch and log CourseOverview.DoesNotExist exceptions, allowing the retirement process to continue by skipping problematic enrollments.
Key changes:
- Added exception handling in
force_optout_allsignal handler to gracefully handle missing CourseOverview records - Added CourseOverview import for exception handling
- Added warning log message when CourseOverview is not found
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description:
User retirement failed when CourseOverview records were missing, causing
CourseOverview.DoesNotExistexceptions in bulk email signal handler.Solution:
Added exception handling in
force_optout_allsignal handler:CourseOverviewimportOptout.objects.get_or_create()in try/except blockPrivate JIRA Link:
BOMS-370