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

Fix issue #169 (force_text depracated) #170

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Conversation

soomy
Copy link
Contributor

@soomy soomy commented Dec 14, 2021

Alias 'force_text' was deprecated in django 3.0 and is gone with 4.0
(https://docs.djangoproject.com/en/4.0/releases/3.0/#features-deprecated-in-3-0)

@agusmakmun
Copy link
Owner

@soomy nice solution, can you please use try except for that?

try:
    from django.utils.encoding import force_str  # noqa: Django>=4.x
except ImportError:
    from django.utils.encoding import force_text as force_str  # noqa: Django<=3.x

@soomy
Copy link
Contributor Author

soomy commented Dec 15, 2021

@agusmakmun good point, I changed the import. However the checks still fail for python<= 3.7... is this expected? Cheers & thanks for this awesome django package!

@agusmakmun agusmakmun merged commit 8c76232 into agusmakmun:master Dec 16, 2021
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.

2 participants