Fix #119664: Persistent state not set when disabling add-ons

The wrong persistent attribute was set when disabling an add-on,
also correct the message when disabling an already disabled add-on.
This commit is contained in:
Campbell Barton 2024-03-20 11:51:33 +11:00
parent 49cd05020c
commit 4ed06c648d
1 changed files with 2 additions and 2 deletions

View File

@ -490,7 +490,7 @@ def disable(module_name, *, default_set=False, handle_error=None):
# the add-on in the user preferences.
if mod and getattr(mod, "__addon_enabled__", False) is not False:
mod.__addon_enabled__ = False
mod.__addon_persistent = False
mod.__addon_persistent__ = False
try:
mod.unregister()
@ -503,7 +503,7 @@ def disable(module_name, *, default_set=False, handle_error=None):
print(
"addon_utils.disable: %s not %s" % (
module_name,
"disabled" if mod is None else "loaded")
"loaded" if mod is None else "enabled")
)
# could be in more than once, unlikely but better do this just in case.