{"record":{"id":"222324d0a34bcae5","repo":"odysseus-dev/odysseus","slug":"admin-only-222324","errorCode":null,"errorMessage":"Admin only","messagePattern":"Admin only","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"routes/note/note_routes.py","lineNumber":864,"sourceCode":"\n        Called by the frontend when a reminder fires. Optionally generates an\n        LLM synthesis line and/or sends an email through configured SMTP.\n        Returns {synthesis, email_sent}.\n        \"\"\"\n        # Gate against anonymous callers — LLM synthesis can burn tokens.\n        user = require_user(request)\n        body = await request.json()\n        note_id = str(body.get(\"note_id\") or \"\").strip()\n        if not note_id:\n            raise HTTPException(400, \"note_id required\")\n\n        caller = _owner(request)\n        is_test = note_id.startswith(\"test-\")\n        is_admin = _is_admin_or_single_user(request, user or caller)\n        _override: dict = {}\n        if is_test:\n            if not is_admin:\n                raise HTTPException(403, \"Admin only\")\n            title = (body.get(\"title\") or \"Test Reminder\").strip() or \"Test Reminder\"\n            note_body = (body.get(\"body\") or \"\").strip()\n            # Optional overrides let the admin settings test button pass the\n            # current UI values directly so it never races a pending save.\n            if body.get(\"channel\"):\n                _override[\"reminder_channel\"] = body[\"channel\"]\n            if body.get(\"webhook_integration_id\"):\n                _override[\"reminder_webhook_integration_id\"] = body[\"webhook_integration_id\"]\n            if body.get(\"webhook_payload_template\"):\n                _override[\"reminder_webhook_payload_template\"] = body[\"webhook_payload_template\"]\n            # Mirror the in-UI AI Synthesis toggle + persona so the test\n            # actually exercises the synthesis path before/without a Save.\n            if \"llm_synthesis\" in body:\n                _override[\"reminder_llm_synthesis\"] = bool(body[\"llm_synthesis\"])\n            if \"llm_persona\" in body:\n                _override[\"reminder_llm_persona\"] = str(body[\"llm_persona\"] or \"\")\n        else:\n            db = SessionLocal()","sourceCodeStart":846,"sourceCodeEnd":882,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/note/note_routes.py#L846-L882","documentation":"Error \"Admin only\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Perform this action with an admin account.","Ask an administrator to run the operation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}