infoportugal/wagtail-modeltranslation

Django 4 `makemigrations` issue

Closed this issue · 3 comments

In Django 4, the migrations autodetector has changed:
https://docs.djangoproject.com/en/4.0/releases/4.0/#migrations-autodetector-changes

For me, this results in the following error when calling manage.py makemigrations:

  File "/project/.venv/lib/python3.10/site-packages/wagtail_modeltranslation/management/commands/makemigrations_translation.py", line 29, in handle
    super(Command, self).handle(*args, **options)
  File "/project/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 98, in wrapped
    res = handle_func(*args, **kwargs)
  File "/project/.venv/lib/python3.10/site-packages/django/core/management/commands/makemigrations.py", line 168, in handle
    autodetector = MigrationAutodetector(
  File "/project/.venv/lib/python3.10/site-packages/wagtail_modeltranslation/management/commands/makemigrations_translation.py", line 12, in wrapper
    from_state_page = from_state.concrete_apps.get_model('wagtailcore', 'page')
AttributeError: 'ProjectState' object has no attribute 'concrete_apps'

Tested with django 4.0.5, wagtail 3.0.1, and wagtail-modeltranslation 0.12rc1

Hey @jorenham

Fixed in v0.12rc2

If you bump into other problemas, let me know!

@DiogoMarques29 That fixed it, thanks!

Aloha @DiogoMarques29 ,

wagtail 2.16.3 brings the same breaking changes as described above. wagtail-modeltranslation-0.11 is not compatible with it anymore, and wagtail >=3.0 is becoming more widespread.

-> could you make a final 0.12 release?

cheers :)