Django 3.2.19 upgrade to 4.2.2 results in a SystemCheckError: System check identified some issues

Been tasked to upgrade a Django 3.2.19 to Django 4.2.2. The upgrade was simple but a make migrations now throws a SystemCheckError: System check identified some issues

Old (working) version information

$ django-admin --version
3.2.19
$ python --version
Python 3.11.4
$ python manage.py  makemigrations
No changes detected

Upgrade version

$ django-admin --version
4.2.2
$ python --version
Python 3.11.4
$ python manage.py  makemigrations
SystemCheckError: System check identified some issues:
ERRORS:
judgingportal.Profile: (models.E020) The 'Profile.check()' class method is currently overridden by <django.db.models.query_utils.DeferredAttribute object at 0xffff95c13790>.

I found reference to this problem in an old StackOverflow post here, but I am not sure what exactly the problem is. Normally Django (and Python) give good error messages.

I suspect the problem is the MixIn I am using. Class definition that is throwing the error.

<snip>
from django_model_changes import ChangesMixin


class Profile(ChangesMixin, models.Model):
<snip>

The package is called and django-model-changes-py3 0.15.1 its GitHub page. Maybe django-model-changes-py3 isn’t compatible with Django 4.x?

Looks like the current maintainer is looking for someone to take over the project.

Is there a different technique to monitor when the model changes in Django 4.x?

The project makes heavy use of the django-model-changes-py3 project. If I need to refactor my project, any recommendations how to do that? Maybe another project that does something similar to django-model-changes-py3? Maybe something build into Django 4.x?

Thanks.

2 Likes