ixc / wagtail-instance-selector

A widget for Wagtail's admin that allows you to create and select related items
MIT License
54 stars 17 forks source link

Define default_app_config for Django < 3.2 only #24

Closed tbrlpld closed 2 years ago

tbrlpld commented 2 years ago

Since Django 3.2 it is not necessary anymore to declare a default_app_config is only a single app config is present in the apps.py.

With that declaration, Django throws deprecation warnings like so:

/venv/lib/python3.8/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'instance_selector' defines default_app_config = 'instance_selector.apps.AppConfig'. Django now detects this configuration automatically. You can remove default_app_config.

This PR adds a conditional check to only define the default_app_config if a Django version lower than 3.2 is used.

Closes #23

tbrlpld commented 2 years ago

@markfinger Was wondering if you could take a look at this one?

markfinger commented 2 years ago

Thanks for the reminder and sorry for the delay. I haven't been near a work computer for a bit.

The changes look great. Unfortunately, I'm not an IC staff member anymore, so I can't merge this. But, I'll ping some folk and see if someone else can. We'll also need to update the PyPI package.

tbrlpld commented 2 years ago

Thanks @markfinger

markfinger commented 2 years ago

@mrmachine @Aramgutang would one of you be able to merge these changes and update the PyPI package?

tbrlpld commented 2 years ago

Bump 😅

Aramgutang commented 2 years ago

@tbrlpld updated package now on PyPi