Cizz22 2 months ago
parent 6293b8ba48
commit 8459a49e34

@ -2,7 +2,9 @@ from typing import List, Optional, Union
from fastapi import APIRouter from fastapi import APIRouter
from fastapi.params import Query from fastapi.params import Query
import requests
from src import config
from src.auth.service import CurrentUser, InternalKey, Token from src.auth.service import CurrentUser, InternalKey, Token
from src.config import DEFAULT_TC_ID from src.config import DEFAULT_TC_ID
from src.database.core import DbSession from src.database.core import DbSession
@ -93,6 +95,10 @@ async def get_calculation_results(db_session: DbSession, calculation_id, token:I
results = await get_calculation_result( results = await get_calculation_result(
db_session=db_session, calculation_id=calculation_id, token=token, include_risk_cost=include_risk_cost db_session=db_session, calculation_id=calculation_id, token=token, include_risk_cost=include_risk_cost
) )
requests.post(f"{config.AUTH_SERVICE_API}/sign-out", headers={
"Authorization": f"Bearer {token}"
})
return StandardResponse( return StandardResponse(
data=results, data=results,

@ -161,7 +161,7 @@ async def get_overview_overhaul(*, db_session: DbSession):
) )
) )
ongoing_result = await db_session.execute(ongoing_query.options(selectinload(OverhaulScope.maintenance_type))) ongoing_result = await db_session.execute(ongoing_query.options(selectinload(OverhaulScope.maintenance_type)))
ongoing_overhaul = ongoing_result.first() ongoing_overhaul = ongoing_result.scalar_one_or_none()
# 2. If no ongoing overhaul, get the closest scheduled overhaul # 2. If no ongoing overhaul, get the closest scheduled overhaul
if ongoing_overhaul is None: if ongoing_overhaul is None:

Loading…
Cancel
Save