octavenz / wagtail-advanced-form-builder

Advanced form builder for Wagtail
BSD 3-Clause "New" or "Revised" License
19 stars 7 forks source link

Django 4 isn't supported #4

Closed andreobriennz closed 1 year ago

andreobriennz commented 1 year ago

When running this with Django 4.0 and Wagtail 3.0 I get this error: ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation'

I think this is because Django removed ugettext_lazy in version 4 (https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0). I've tried replacing the import with from django.utils.translation import gettext_lazy as _ and it seems to work. As far as I can see in the docs it looks like gettext_lazy is supported by Django 2 and 3. Is there anything preventing this being updated?

Siburg commented 1 year ago

@andreobriennz you're right. We were getting the same issue ourselves. Just updated the package to fix it, as well as other compatibility issues.

Siburg commented 1 year ago

Should be fixed. Let us know if there are remaining issues with Django 4.

andreobriennz commented 1 year ago

Thanks @Siburg

I later noticed that issue with value.strip() not working if there's a list of items, but looks like someone else has already opened a pr for it. I think there's a couple other functions that might need to be updated as well though so I'll leave a comment there.