Skip to content

Commit c8afbaf

Browse files
committed
refactor: replace User model import with get_user_model for better compatibility
1 parent 5184f5b commit c8afbaf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lms/djangoapps/instructor/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import logging
99
from typing import Callable, Optional
1010

11-
from django.contrib.auth.models import User
11+
from django.contrib.auth import get_user_model
1212
from django.core.exceptions import ValidationError
1313
from django.core.validators import validate_email
1414
from opaque_keys.edx.keys import CourseKey
@@ -37,8 +37,11 @@
3737
log = logging.getLogger(__name__)
3838

3939

40+
User = get_user_model()
41+
42+
4043
def process_single_student_enrollment(
41-
request_user: User,
44+
request_user,
4245
course_key: CourseKey,
4346
action: str,
4447
identifier: str,
@@ -153,7 +156,7 @@ def process_single_student_enrollment(
153156

154157

155158
def process_student_enrollment_batch(
156-
request_user: User,
159+
request_user,
157160
course_key: CourseKey,
158161
action: str,
159162
identifiers: list[str],

0 commit comments

Comments
 (0)