fix(circles): protect primary circle from rename in update_circle (v0.7.5)

Adds isFirstFamily check to update_circle — mirrors the same guard
already present in delete_circle. Attempting to rename the primary
circle now returns a clear error instead of silently renaming it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 21:39:57 +02:00
parent 02f9d62720
commit eb022e2376
5 changed files with 24 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
__version__ = "0.7.4"
__version__ = "0.7.5"
+16
View File
@@ -1399,6 +1399,22 @@ def update_circle(circle_id: str, name: str) -> str:
indent=2,
)
if target.get("isFirstFamily") == "true":
client.logout()
return json.dumps(
{
"error": "Cannot rename the primary circle.",
"id": circle_id,
"name": target.get("name"),
"hint": (
"The primary (first) circle cannot be renamed via the API. "
"Use the Family Wall app settings to manage it."
),
},
ensure_ascii=False,
indent=2,
)
# Rename the circle.
# Verified: accupdatefamily with scope=<circle_metaId> targets any circle,
# both primary and secondary. The server capitalises the first letter.