Fix bug involving plugin duplicate names

master
Arinerron 2018-05-13 21:22:28 -07:00
parent 15d0e7c6fd
commit 019f13fe8d
No known key found for this signature in database
GPG Key ID: 99383627861C62F0
1 changed files with 11 additions and 8 deletions

View File

@ -62,6 +62,7 @@ def enable(name, onionr = None, start_event = True):
if exists(name): if exists(name):
enabled_plugins = get_enabled_plugins() enabled_plugins = get_enabled_plugins()
if not name in enabled_plugins:
enabled_plugins.append(name) enabled_plugins.append(name)
config_plugins = config.get('plugins') config_plugins = config.get('plugins')
config_plugins['enabled'] = enabled_plugins config_plugins['enabled'] = enabled_plugins
@ -73,6 +74,8 @@ def enable(name, onionr = None, start_event = True):
start(name) start(name)
return True return True
else:
return False
else: else:
logger.error('Failed to enable plugin \"' + name + '\", disabling plugin.') logger.error('Failed to enable plugin \"' + name + '\", disabling plugin.')
disable(name) disable(name)