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:
@@ -1 +1 @@
|
||||
__version__ = "0.7.4"
|
||||
__version__ = "0.7.5"
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user