refactor: deprecate hostname attribute from ModuleSystem (#30308)

The hostname constructor argument of the XModule ModuleSystem is deprecated
in favour of directly accessing the LMS_BASE value from django.conf.settings.
This commit is contained in:
Arunmozhi
2022-06-09 03:49:58 +10:00
committed by GitHub
parent 8886f29e52
commit aedcd7910d
6 changed files with 36 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ class TestLTI(BaseTestXmodule):
context_id = str(self.item_descriptor.course_id)
user_service = self.item_descriptor.xmodule_runtime.service(self.item_descriptor, 'user')
user_id = str(user_service.get_current_user().opt_attrs.get(ATTR_KEY_ANONYMOUS_USER_ID))
hostname = self.item_descriptor.xmodule_runtime.hostname
hostname = settings.LMS_BASE
resource_link_id = str(urllib.parse.quote(f'{hostname}-{self.item_descriptor.location.html_id()}'))
sourcedId = "{context}:{resource_link}:{user_id}".format(