This commit is contained in:
Timothy Jaeryang Baek
2026-05-09 06:33:26 +09:00
parent 794b97025d
commit 1d892ce2c5

View File

@@ -395,14 +395,16 @@ class CalendarTable:
# Delete events # Delete events
await db.execute(delete(CalendarEvent).filter(CalendarEvent.calendar_id == id)) await db.execute(delete(CalendarEvent).filter(CalendarEvent.calendar_id == id))
# Delete access grants
await AccessGrants.revoke_all_access('calendar', id, db=db)
# Delete calendar # Delete calendar
await db.execute(delete(Calendar).filter(Calendar.id == id)) await db.execute(delete(Calendar).filter(Calendar.id == id))
await db.commit() await db.commit()
# Revoke access grants in a separate transaction to avoid
# write-lock contention on SQLite when session sharing is off.
await AccessGrants.revoke_all_access('calendar', id)
return True return True
except Exception: except Exception as e:
log.exception(f'Failed to delete calendar {id}: {e}')
return False return False