feat(settings): save display settings without an API key
Asking for the key every time a phone changes a chart option was friction the owner doesn't want. These settings only change how data is displayed (averaging, scale, chart range, language default), so PUT /api/settings is now open. Inverter edits (name, kWp, ...) and ingest still need the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-7
@@ -139,14 +139,11 @@ def get_view_settings(conn: Db):
|
||||
return _load_view_settings(conn)
|
||||
|
||||
|
||||
@router.put(
|
||||
"/settings",
|
||||
response_model=ViewSettings,
|
||||
dependencies=[Depends(require_api_key)],
|
||||
tags=["settings"],
|
||||
)
|
||||
@router.put("/settings", response_model=ViewSettings, tags=["settings"])
|
||||
def put_view_settings(conn: Db, body: ViewSettings):
|
||||
"""Replace the display options for every viewer. Omitted keys reset to their default."""
|
||||
"""Replace the display options for every viewer. Omitted keys reset to their default.
|
||||
Open to anyone on purpose: these only change how data is displayed, and
|
||||
the owner wants them adjustable without a key."""
|
||||
set_meta(conn, SETTINGS_KEY, body.model_dump_json())
|
||||
return body
|
||||
|
||||
|
||||
Reference in New Issue
Block a user