Set the extension instance early enough for admin registration.
Review Request #12236 — Created April 18, 2022 and submitted — Latest diff uploaded
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 eitherinstance
being an invalid attribute or beingNone
,
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 theinstance
attribute.
Unit tests pass.