diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index f8f2f6caf6cd..be6eed8f7732 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -68,6 +68,10 @@ COURSE_UNENROLLMENT_COMPLETED, ) from openedx_filters.learning.filters import CourseEnrollmentStarted, CourseUnenrollmentStarted + +from organizations import api as organizations_api +from organizations.models import Organization, UserOrganizationMapping + import openedx.core.djangoapps.django_comment_common.comment_client as cc from common.djangoapps.course_modes.models import CourseMode, get_cosmetic_verified_display_price from common.djangoapps.student.emails import send_proctoring_requirements_email @@ -99,9 +103,6 @@ from openedx.core.djangolib.model_mixins import DeletableByUserValue from openedx.core.toggles import ENTRANCE_EXAMS -from organizations import api as organizations_api -from organizations.models import Organization, UserOrganizationMapping - log = logging.getLogger(__name__) AUDIT_LOG = logging.getLogger("audit") SessionStore = import_module(settings.SESSION_ENGINE).SessionStore # pylint: disable=invalid-name @@ -1740,7 +1741,7 @@ def enroll(cls, user, course_key, mode=None, check_access=False, can_upgrade=Fal user_org.save() except Exception as excep: # lint-amnesty, pylint: disable=broad-except - log.error(u"Could not create UserOrganizationMapping for org %s, user %s\n%s", + log.error("Could not create UserOrganizationMapping for org %s, user %s\n%s", organization.name, user.username, excep