Reject CalDAV writeback events without uid (#1582)

This commit is contained in:
red person
2026-06-03 02:57:15 +03:00
committed by GitHub
parent 0ad5cd783b
commit 8051e25c65
2 changed files with 11 additions and 1 deletions
+4 -1
View File
@@ -93,11 +93,14 @@ def push_event(calendars, local_cal_id: str, ev: dict, *, delete: bool = False)
Returns ``{"ok": bool, ...}``. ``calendars`` is the discovered caldav
calendar list (injected so this is unit-testable with fakes).
"""
uid = (ev or {}).get("uid") if isinstance(ev, dict) else None
if not uid:
return {"ok": False, "error": "event uid is required"}
remote = find_remote_calendar(calendars, local_cal_id)
if remote is None:
return {"ok": False, "error": "remote calendar not found"}
uid = ev["uid"]
try:
existing = remote.event_by_uid(uid)
except Exception: