Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore not recognized characters #1471

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion rbac/management/principal/cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def process_umb_event(frame, umb_client: Stomp, bootstrap_service: TenantBootstr
return False

try:
data_dict = xmltodict.parse(frame.body)
body = frame.body.decode("utf-8", errors="ignore")
data_dict = xmltodict.parse(body)
canonical_message = data_dict.get("CanonicalMessage")

user = retrieve_user_info(canonical_message)
Expand Down
2 changes: 1 addition & 1 deletion tests/management/principal/test_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_principal_cleanup_principal_error(self, mock_request):
b'<Reference system="EBS" entity-name="Account" qualifier="number">11111111</Reference>\n '
b'</Identifiers>\n <Status primary="true">\n <State>Active</State>\n '
b"</Status>\n <Person>\n <FirstName>Test</FirstName>\n "
b"<LastName>Principal</LastName>\n <Salutation>Mr.</Salutation>\n <Title>QE</Title>\n "
b"<LastName>Principal \xed\xa0\xbd\xed\xb8\x8e</LastName>\n <Salutation>Mr.</Salutation>\n <Title>QE</Title>\n "
b"<Credentials>\n <Login>principal-test</Login>\n </Credentials>\n "
b"</Person>\n <Company>\n <Name>Shakespeare Birthplace Trust</Name>\n "
b"</Company>\n <Address>\n <Identifiers>\n <AuthoringOperatingUnit>\n"
Expand Down
Loading