Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions xmodule/html_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,20 @@ def get_html(self):
""" Returns html required for rendering the block. """
if self.data:
data = self.data
user_id = (
user = (
self.runtime.service(self, 'user')
.get_current_user()
.opt_attrs.get(ATTR_KEY_DEPRECATED_ANONYMOUS_USER_ID)

)
user_id = user.opt_attrs.get(ATTR_KEY_DEPRECATED_ANONYMOUS_USER_ID)
if user_id:
data = data.replace("%%USER_ID%%", user_id)
data = data.replace("%%COURSE_ID%%", str(self.scope_ids.usage_id.context_key))

# EDLYCUSTOM: Replace %%USER_EMAIL%% with user's email in HTML xblock
email = user.emails[0]
data = data.replace("%%USER_EMAIL%%", email)

return data
return self.data

Expand Down
Loading