1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-27 10:07:22 +00:00

Convert old auth settings to new

This commit is contained in:
Halali 2018-09-17 14:18:52 +02:00
parent 3bedabc08c
commit 3bed120a8e

13
init.py
View file

@ -235,9 +235,16 @@ try:
cfg.read_file(f) cfg.read_file(f)
except Exception: except Exception:
pass pass
cfg.remove_option('auth', 'enabled') if cfg.has_section('auth'):
with open(config_file, 'w+') as configfile: if cfg.has_option('auth', 'enabled'):
cfg.write(configfile) enabled = cfg.getboolean('auth', 'enabled')
if enabled is True:
cfg.set('auth', 'type', 'basic')
elif enabled is False:
cfg.set('auth', 'type', 'basic')
cfg.remove_option('auth', 'enabled')
with open(config_file, 'w+') as configfile:
cfg.write(configfile)
from cork import Cork from cork import Cork
import time import time