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

Use of Django ugettext_lazy breaks with Django 4+ #35

Closed
chosak opened this issue Dec 20, 2022 · 1 comment
Closed

Use of Django ugettext_lazy breaks with Django 4+ #35

chosak opened this issue Dec 20, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@chosak
Copy link
Member

chosak commented Dec 20, 2022

This project uses Django's ugettext_lazy method in several places. ugettext_lazy was deprecated in Django 3.0 and removed in Django 4.0.

This project doesn't specify a particular pinned range for Django in its setup.py (although it does for testing). This causes a failure unless you pin Django < 4:

% pip install wagtail-treemodeladmin
% pip freeze | grep Django==
Django==4.0.8
% pip freeze | grep wagtail==
wagtail==2.16.3
% wagtail start myproject
% cd myproject
# Edit myproject/settings/base.py to add 'treemodeladmin' to INSTALLED_APPS
% ./manage.py migrate
...
    from django.utils.translation import ugettext_lazy as _
ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'
@chosak chosak added the bug Something isn't working label Dec 20, 2022
@willbarton
Copy link
Member

Good catch, thanks! I've replaced ugettext in df3a0a7 in #34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants