profile id support in api requests

This commit is contained in:
Mateusz Gruszczyński
2026-06-16 19:46:16 +02:00
parent c796a740d1
commit a73aeb5544
18 changed files with 1823 additions and 185 deletions
+2 -2
View File
@@ -491,9 +491,9 @@ def get_preferences(user_id: int | None = None, profile_id: int | None = None):
merged.update(get_disk_monitor_preferences(profile_id, user_id))
return merged
def save_preferences(data: dict, user_id: int | None = None):
def save_preferences(data: dict, user_id: int | None = None, profile_id: int | None = None):
user_id = user_id or auth.current_user_id() or default_user_id()
profile_id = _active_profile_id_for_user(user_id)
profile_id = profile_id or _active_profile_id_for_user(user_id)
allowed_theme = data.get("theme") if data.get("theme") in {"light", "dark"} else None
bootstrap_theme = data.get("bootstrap_theme") if data.get("bootstrap_theme") in BOOTSTRAP_THEMES else None
font_family = data.get("font_family") if data.get("font_family") in FONT_FAMILIES else None