Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas committed Jan 7, 2024
1 parent 5fa1dc3 commit 0b42a42
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from api_classes.result_format import ResultFormat
from api_classes.translate_payload import TranslatePayload
from api_utils import utils

# pylint: disable=wrong-import-order
from api_utils.utils import dump_yaml
from classes.ci_credentials import CICredentials
Expand Down Expand Up @@ -264,14 +265,16 @@ def publish(payload: PublishPayload, target: Target) -> Dict[str, Optional[str]]
pass
if not windfile:
raise HTTPException(status_code=422, detail="Invalid windfile")
generated: Optional[Dict[str, str | None]] = generate_target_script(
windfile=windfile,
target=target,
credentials=CICredentials(url=payload.url, username=payload.username, token=payload.token),
)
if not generated:
return {"detail": "generation failed, check api logs"}
return generated
if payload.url and payload.username and payload.token:
generated: Optional[Dict[str, str | None]] = generate_target_script(
windfile=windfile,
target=target,
credentials=CICredentials(url=payload.url, username=payload.username, token=payload.token),
)
if not generated:
return {"detail": "generation failed, check api logs"}
return generated
return {"detail": "missing credentials"}


@app.put("/translate/{source}/{build_plan_id}")
Expand Down

0 comments on commit 0b42a42

Please sign in to comment.