Skip to content

Guard ui_locales.split() #879

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

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Guard ui_locales.split() #879

merged 1 commit into from
Oct 21, 2024

Conversation

jaap3
Copy link
Contributor

@jaap3 jaap3 commented Aug 27, 2024

request.ui_locales might already be a list, only split the value if the split method is available.

I'm creating this PR because I ran into an issue with django-oauth-toolkit, I've added a workaround there:

django-oauth/django-oauth-toolkit#1469

Since I'm unsure if this is a bug in oauthlib, or is caused by unexpected use by django-oauth-toolkit I'm suggesting this change here as well.

I will add a test if this is deemed an acceptable fix.

@auvipy auvipy self-requested a review September 9, 2024 14:58
Copy link
Contributor

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need tests to verify the proposed change as well

Copy link
Contributor

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add/modify unit tests to verify this

`request.ui_locales` might already be a list, only split the value if the `split` method is available.
Copy link
Contributor Author

@jaap3 jaap3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auvipy I added/updated the tests.

@jaap3 jaap3 requested a review from auvipy October 21, 2024 09:34
@auvipy auvipy merged commit 1fd5253 into oauthlib:master Oct 21, 2024
12 checks passed
@JonathanHuot JonathanHuot added this to the 3.3.0 milestone May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants