feat(ocr): Add docTR OCR engine with metrics infrastructure
Add docTR as primary OCR engine with 2-tier sequential processing, OCR metrics tracking, and simplified engine selection. Features: - docTR OCR engine with light+medium preprocessing tiers - doctr_plus mode with early exit optimization (~65% fast path) - OCR metrics dashboard with per-engine statistics - User OCR preference persistence - Parallel worker pool for OCR processing - Cross-validation for extraction quality Engine options: tesseract, doctr, doctr_plus (recommended), paddleocr 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -109,15 +109,7 @@ async def get_current_user_from_request(request: Request) -> CurrentUser:
|
||||
Raises:
|
||||
HTTPException: Dacă utilizatorul nu este autentificat
|
||||
"""
|
||||
print(f"[DEPENDENCY DEBUG] get_current_user_from_request called")
|
||||
print(f"[DEPENDENCY DEBUG] request.state attributes: {dir(request.state)}")
|
||||
print(f"[DEPENDENCY DEBUG] has is_authenticated: {hasattr(request.state, 'is_authenticated')}")
|
||||
print(f"[DEPENDENCY DEBUG] is_authenticated value: {getattr(request.state, 'is_authenticated', 'NOT_SET')}")
|
||||
print(f"[DEPENDENCY DEBUG] has user: {hasattr(request.state, 'user')}")
|
||||
print(f"[DEPENDENCY DEBUG] user value: {getattr(request.state, 'user', 'NOT_SET')}")
|
||||
|
||||
if not hasattr(request.state, 'is_authenticated') or not request.state.is_authenticated:
|
||||
print(f"[DEPENDENCY DEBUG] Returning 401: Authentication required")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Authentication required",
|
||||
@@ -125,14 +117,12 @@ async def get_current_user_from_request(request: Request) -> CurrentUser:
|
||||
)
|
||||
|
||||
if not hasattr(request.state, 'user') or not request.state.user:
|
||||
print(f"[DEPENDENCY DEBUG] Returning 401: User not found in request")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="User not found in request",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
|
||||
print(f"[DEPENDENCY DEBUG] Returning user: {request.state.user}")
|
||||
|
||||
return request.state.user
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user