From 9bd13a7796b9c8dfebbc4dbcd14a4bd058565833 Mon Sep 17 00:00:00 2001 From: Henrry Pulgarin <39854568+Henrrypg@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:17:34 -0500 Subject: [PATCH] fix: unboundLocalError for enrollment backend (#242) --- eox_core/edxapp_wrapper/backends/enrollment_l_v1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eox_core/edxapp_wrapper/backends/enrollment_l_v1.py b/eox_core/edxapp_wrapper/backends/enrollment_l_v1.py index 1f8aaadad..0ef87d94a 100644 --- a/eox_core/edxapp_wrapper/backends/enrollment_l_v1.py +++ b/eox_core/edxapp_wrapper/backends/enrollment_l_v1.py @@ -208,6 +208,7 @@ def _enroll_on_course(user, course_id, *args, **kwargs): LOG.info('Force create enrollment %s, %s, %s', username, course_id, mode) enrollment = _force_create_enrollment(username, course_id, mode, is_active) else: + err_msg = None if not str(err): err_msg = err.__class__.__name__ raise APIException(detail=err_msg if err_msg else err) from err