Add trading journal and portfolio tracking
This commit is contained in:
@@ -10,6 +10,7 @@ from database import connect
|
||||
from models import CATEGORIES, decimal_string
|
||||
from services import asset_service, income_service
|
||||
from api.auth import require_token
|
||||
from trading_models import TradingValidationError
|
||||
from api.schemas import (
|
||||
AssetCreate, AssetPatch, AssetResponse, AssetShareResponse, Category,
|
||||
CategoryShareResponse, IncomeCreate, IncomePatch, IncomeResponse,
|
||||
@@ -30,6 +31,8 @@ class SafeAPIRoute(APIRoute):
|
||||
# Never echo raw request bodies, credentials or internal exception context.
|
||||
details = [{'loc': e['loc'], 'msg': e['msg'], 'type': e['type']} for e in error.errors()]
|
||||
return JSONResponse({'detail': details}, status_code=422)
|
||||
except TradingValidationError as error:
|
||||
return JSONResponse({'detail': str(error)}, status_code=422)
|
||||
except ValueError:
|
||||
return JSONResponse({'detail': 'Ungültige Werte. Bitte Felder und Position prüfen.'}, status_code=422)
|
||||
except sqlite3.IntegrityError:
|
||||
|
||||
Reference in New Issue
Block a user