File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 2020
2121# Imports ###########################################################
2222
23- from django .conf import settings
2423from django .contrib .auth .models import User
2524from django .db import models
2625from django .db .models .signals import pre_delete
2726
2827try :
29- # workaround so we don't explicitly import the AnonymousUserId model from LMS
30- if "common.djangoapps.student.apps.StudentConfig" in settings .INSTALLED_APPS :
31- # Koa and beyond:
28+ # Koa and earlier: use shortened import path.
29+ # This will raise a warning in Koa, but that's OK.
30+ from student .models import AnonymousUserId
31+ except Exception : # pylint: disable=broad-except
32+ # (catch broadly, since the exception could manifest as either an ImportError
33+ # or an EdxPlatformDeprecatedImportError, the latter of which is not a subclass
34+ # of the former, and only exists on edx-platform master between Koa and Lilac).
35+ try :
36+ # Post-Koa: we must use the full import path.
3237 from common .djangoapps .student .models import AnonymousUserId
33- else :
34- # Juniper and earlier
35- from student .models import AnonymousUserId
36- except ImportError :
37- # Not running the LMS (e.g. tests)
38- AnonymousUserId = None
38+ except ImportError :
39+ # If we get here, we are not running within edx-platform
40+ # (e.g., we are running problem-builder unit tests).
41+ AnonymousUserId = None
3942
4043
4144# Classes ###########################################################
Original file line number Diff line number Diff line change 2828
2929# Constants #########################################################
3030
31- VERSION = '4.1.9 '
31+ VERSION = '4.1.10 '
3232
3333# Functions #########################################################
3434
You can’t perform that action at this time.
0 commit comments