Set the extension instance early enough for admin registration.

Review Request #12236 — Created April 18, 2022 and submitted — Latest diff uploaded

Information

Djblets
release-2.x

Reviewers

When initializing an extension, we set extension_cls.instance to the
initialized extension, but we do this after some extension-supplied code
(the administration site setup) is run. This causes such code to fail
with either instance being an invalid attribute or being None,
depending on any prior initialization.

We now set this alongside storing the extension instance in the manager,
ensuring that there's always consistency between looking up an extension
via the extension manager and via the instance attribute.

Unit tests pass.

Commits

Files