mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 12:08:47 +02:00
Consistency sweep: enum members, keyword status codes, SimpleCookie
analytics.py filters by TransactionType.COMPRA instead of the string literal; budget.py uses keyword HTTPException args; the agent middleware parses cookies with stdlib SimpleCookie instead of a regex (ARCH-10); auth.py's lazy imports are hoisted — there was never an actual auth/db cycle (ARCH-20); transactions.py hoists or_/and_. Verified: dev container boots, agent auth paths return 401 for missing/garbage cookies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -248,9 +248,9 @@ def upsert_balance_override(
|
||||
_user: str = Depends(get_current_user),
|
||||
):
|
||||
if year < MIN_YEAR or year > MAX_YEAR:
|
||||
raise HTTPException(400, f"Year must be between {MIN_YEAR} and {MAX_YEAR}")
|
||||
raise HTTPException(status_code=400, detail=f"Year must be between {MIN_YEAR} and {MAX_YEAR}")
|
||||
if year == FRESH_START_YEAR and month < FRESH_START_MONTH:
|
||||
raise HTTPException(400, f"Cannot override before {FRESH_START_YEAR}-{FRESH_START_MONTH:02d}")
|
||||
raise HTTPException(status_code=400, detail=f"Cannot override before {FRESH_START_YEAR}-{FRESH_START_MONTH:02d}")
|
||||
|
||||
existing = session.exec(
|
||||
select(BalanceOverride).where(
|
||||
@@ -288,6 +288,6 @@ def delete_balance_override(
|
||||
)
|
||||
).first()
|
||||
if not existing:
|
||||
raise HTTPException(404, "No override found for this month")
|
||||
raise HTTPException(status_code=404, detail="No override found for this month")
|
||||
session.delete(existing)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user