Wrapping up the portal settings

This commit is contained in:
Ana Custura 2026-03-10 10:27:59 +00:00
parent 2d3338b835
commit a7cb20cf2f
4 changed files with 16 additions and 11 deletions

View file

@ -17,7 +17,7 @@ import glob
import time
import qrcode
CHANGES_REQUIRING_RESTART = ['wifi_password', 'ssid', 'enable_access_point', 'enable_chat', 'enable_delta_chat', 'butterbox_hostname', 'ssh_access_settings', 'root_account_settings']
CHANGES_REQUIRING_RESTART = ['wifi_password', 'ssid', 'enable_access_point', 'enable_chat', 'enable_delta_chat', 'butterbox_hostname', 'ssh_access_settings', 'root_account_settings', 'root_password']
def gen_username() -> str:
@ -159,7 +159,7 @@ def logout():
def admin():
raspap_installed = os.path.exists("/var/www/html/raspap")
form = SettingsForm()
populate_settings = ['butterbox_name', 'wifi_password', 'ssid', 'butterbox_hostname', 'root_account_settings', 'ssh_access_settings']
populate_settings = ['butterbox_name', 'wifi_password', 'ssid', 'butterbox_hostname', 'root_account_settings', 'ssh_access_settings', 'root_password', 'admin_password']
bool_settings = ['enable_access_point','enable_file_viewer', 'enable_map_viewer', 'enable_app_store', 'enable_chat', 'enable_deltachat', 'enable_wifi_sharing']
populate_settings.extend(bool_settings)
if not form.is_submitted():
@ -203,9 +203,6 @@ def admin():
admin_user.set_password(new_admin_password)
db.session.add(admin_user)
non_admin_settings_changed = True
else:
form.admin_password.errors.append(
_("New admin password same as old password. Not changing."))
if app.config['SETTINGS_CHANGED']:
flash(_("⚠️ Some settings may not fully take effect until the Butter Box restarts. Click 'Apply Changes' to restart."))
else: