Skip to content

Commit

Permalink
fix: remove utf-8 encoding for full name (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto authored Jun 7, 2024
1 parent f8f36b3 commit 8636d58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel
Unreleased
~~~~~~~~~~

9.11.3 - 2024-05-30
-------------------
* Remove utf-8 encoding for user full name

9.11.2 - 2024-05-30
-------------------
* Update python version for pypi publish workflow
Expand Down
2 changes: 1 addition & 1 deletion lti_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .apps import LTIConsumerApp
from .lti_xblock import LtiConsumerXBlock

__version__ = '9.11.2'
__version__ = '9.11.3'
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.encode(),
'user_full_name': user.full_name,
'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 @@ -1078,7 +1078,7 @@ def test_lti_launch_pii_sharing(

set_user_data_kwargs['person_sourcedid'] = 'fake' if pii_sharing_enabled and ask_to_send_username else None
set_user_data_kwargs['person_name_full'] = (
'fáke fǔll ñamë'.encode() if pii_sharing_enabled and ask_to_send_full_name else None
'fáke fǔll ñamë' if pii_sharing_enabled and ask_to_send_full_name else None
)
set_user_data_kwargs['person_contact_email_primary'] = (
'[email protected]' if pii_sharing_enabled and ask_to_send_email else None
Expand Down Expand Up @@ -1867,7 +1867,7 @@ def test_get_lti_1p3_launch_data(
expected_launch_data_kwargs["preferred_username"] = fake_username

if ask_to_send_full_name:
expected_launch_data_kwargs["name"] = fake_name.encode()
expected_launch_data_kwargs["name"] = fake_name

if ask_to_send_email:
expected_launch_data_kwargs["email"] = fake_user_email
Expand Down

0 comments on commit 8636d58

Please sign in to comment.