Lazily fetch the django_evolution app.

Review Request #11875 — Created Nov. 16, 2021 and submitted — Latest diff uploaded

Information

Django Evolution
release-2.x

Reviewers

After a syncdb or migrate, django_evolution.management attempts to
record new state in the database, but it only does so once the
django_evolution app and its tables have been made available in the
database. For this, it needs a reference to the app, which was being
done at module initialization.

It's possible for this code to run too early, before other apps are
properly set up, which could cause failures either fetching the app or
from some logic within the app.

To avoid this, we now lazily fetch the app the first time we need it,
caching it for future reference.

Unit tests pass.

Successfully created new databases and upgraded existing ones.

Commits

Files