test(mcp): import only User locally; UserRole comes from the enclosing scope (#5035)
CI / lint (push) Successful in 1s
CI / integration (push) Successful in 43s
CI / unit (push) Successful in 1m2s
CI / publish (push) Successful in 1m5s

The local import shadowed UserRole for the whole function, so its earlier
use read an unassigned name (ruff F823, CI run 8294).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 11:03:16 -04:00
co-authored by Claude Opus 5.5
parent 7a3f7869fe
commit b1da073677
+1 -1
View File
@@ -255,7 +255,7 @@ def test_docker_and_agent_tools_over_seeded_rows(app):
# ── the web pages say the same ─────────────────────────────────────
# A real viewer: every request re-reads the session's user (refresh_session_user).
from steward.models.users import User, UserRole
from steward.models.users import User
viewer_id = str(uuid.uuid4())
async with app.db_sessionmaker() as s, s.begin():
s.add(User(id=viewer_id, username=f"viewer-{viewer_id[:8]}", email=f"{viewer_id}@test",