The following ModuleSystem attributes are deprecated by this change, and should be pulled directly from the user service instead:
* anonymous_student_id
* seed
* user_id
* user_is_staff
Related changes:
* Removes the `user` and `anonymous_student_id` parameters from the ModuleService constructor.
* Stores anonymous_user_id in XBlockDjangoUserService's opt_attr
* Pulls out constants used by DjangoXBlockUserService opt_attr so they can be used in the platform code.
* LmsModuleSystem uses the user service created in wrapper function for runtime.publish to avoid requiring the user
service to be "needed" by all XBlocks.
* LmsModuleSystem no longer checks for instances of XModuleDescriptor when deciding what kind of anonymous_user_id to
provide: all XModules are XBlocks, so this check is unnecessary.
* XBlockRuntime returns a user service when requested
* Adds tests for deprecated ModuleSystem attributes and changes to XBlockDjangoUserService.
(cherry picked from commit c41e7fb93a)
12 lines
420 B
Python
12 lines
420 B
Python
"""
|
|
Constants used by DjangoXBlockUserService
|
|
"""
|
|
|
|
# Optional attributes stored on the XBlockUser
|
|
ATTR_KEY_ANONYMOUS_USER_ID = 'edx-platform.anonymous_user_id'
|
|
ATTR_KEY_IS_AUTHENTICATED = 'edx-platform.is_authenticated'
|
|
ATTR_KEY_USER_ID = 'edx-platform.user_id'
|
|
ATTR_KEY_USERNAME = 'edx-platform.username'
|
|
ATTR_KEY_USER_IS_STAFF = 'edx-platform.user_is_staff'
|
|
ATTR_KEY_USER_PREFERENCES = 'edx-platform.user_preferences'
|