Skip to content

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