Skip to content

Commit

Permalink
fix: add utf-8 encoding for user fields
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto committed May 29, 2024
1 parent 2efe2bb commit 651c137
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lti_consumer/lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ def extract_real_user_data(self):
user_data = {
'user_email': None,
'user_username': None,
'user_full_name': user.full_name,
'user_full_name': user.full_name.encode(),
'user_language': None,
}

Expand Down
4 changes: 2 additions & 2 deletions lti_consumer/tests/unit/test_lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def setUp(self):
fake_user_email = 'abc@example.com'
fake_user.emails = [fake_user_email]

full_name_mock = PropertyMock(return_value='fake_full_name')
full_name_mock = PropertyMock(return_value='fáke ñamë')
type(fake_user).full_name = full_name_mock

fake_username = 'fake'
Expand Down Expand Up @@ -1814,7 +1814,7 @@ def test_get_lti_1p3_launch_data(
fake_user_email = 'fake_email@example.com'
fake_username = 'fake_username'

fake_name = 'fake_full_name'
fake_name = 'fáke fǔll ñamë'
full_name_mock = PropertyMock(return_value=fake_name)
type(fake_user).full_name = full_name_mock

Expand Down

0 comments on commit 651c137

Please sign in to comment.