only install madmail if selected

also reinstall/config if toggled in admin
This commit is contained in:
n8fr8 2026-05-07 21:17:36 -04:00
parent aed9fe1d33
commit 31a915e1ad

View file

@ -270,7 +270,8 @@ def step4():
set_setting(s, setting_value) set_setting(s, setting_value)
set_setting('first_setup', "false") set_setting('first_setup', "false")
dump_settings("settings.txt") dump_settings("settings.txt")
run_madmail_installer() if get_setting("enable_deltachat") == "true":
run_madmail_installer()
db.session.commit() db.session.commit()
return redirect(url_for('setup_complete')) return redirect(url_for('setup_complete'))
if get_setting("first_setup") == "true": if get_setting("first_setup") == "true":
@ -312,6 +313,7 @@ def admin_settings():
print(form.errors) print(form.errors)
if form.validate_on_submit(): if form.validate_on_submit():
if form.submit.data: if form.submit.data:
deltachat_newly_enabled = False
for s in populate_settings: for s in populate_settings:
new_value = getattr(form, s).data new_value = getattr(form, s).data
if s in bool_settings: if s in bool_settings:
@ -325,6 +327,10 @@ def admin_settings():
non_admin_settings_changed = True non_admin_settings_changed = True
if s in CHANGES_REQUIRING_RESTART: if s in CHANGES_REQUIRING_RESTART:
app.config['SETTINGS_CHANGED'] = True app.config['SETTINGS_CHANGED'] = True
if s == 'enable_deltachat' and new_value == "true":
deltachat_newly_enabled = True
if deltachat_newly_enabled:
run_madmail_installer()
new_logo = form.butterbox_logo.data new_logo = form.butterbox_logo.data
if new_logo.filename: if new_logo.filename: