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

Change force_text to force_str to remove RemoveInDjango40Warning #311

Closed
wants to merge 3 commits into from
Closed

Conversation

rhenter
Copy link

@rhenter rhenter commented Aug 31, 2020

Change force_text to force_str to remove RemoveInDjango40Warning

.../smart_selects/utils.py:73: RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
  results.sort(key=lambda x: unicode_sorter(force_text(x)))
.../smart_selects/utils.py:55: RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
  {'value': item.pk if str(item.pk).isdigit() else str(item.pk), 'display': force_text(item)} for item in results

```
.../site-packages/smart_selects/utils.py:55: RemovedInDjango40Warning: force_text() is deprecated in favor of force_str().
  {'value': item.pk if str(item.pk).isdigit() else str(item.pk), 'display': force_text(item)} for item in results
```
@manelclos
Copy link
Member

Hi @rhenter thanks for the PR. It seems tests are not passing, maybe we need it to conditionally use one function or another depending on the Django version. I'd not like to drop support for Django 1.8 until we release a new major version.

@rhenter
Copy link
Author

rhenter commented Aug 31, 2020

Make sense! I'm closing this PR

@rhenter rhenter closed this Aug 31, 2020
@manelclos
Copy link
Member

@rhenter you can reuse this PR and squash commits at the end.

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.

None yet

2 participants