docs(06.2): capture phase context + fix admin user creation 500
- Phase 6.2 CONTEXT.md: cloud-delete propagation, SHARE-03/05, audit log CSV export fix, daily export UI, user handle display - Fix: admin create_user missing session.flush() before write_audit_log caused FK violation on PostgreSQL (silent on SQLite) - Regression test: test_create_user_writes_audit_log in test_admin_api.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -244,6 +244,7 @@ async def create_user(
|
||||
used_bytes=0,
|
||||
)
|
||||
session.add(quota)
|
||||
await session.flush() # persist User + Quota before audit_log FK references them
|
||||
# D-13: admin user created event
|
||||
_ip = request.headers.get("X-Forwarded-For") or (request.client.host if request.client else None)
|
||||
await write_audit_log(
|
||||
|
||||
Reference in New Issue
Block a user