Compare commits
2 commits
main
...
bugfix/pos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80a6c1e140 | ||
|
|
92b3afe9d6 |
5 changed files with 28 additions and 27 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends postgresql-client && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY pyproject.toml .
|
COPY pyproject.toml .
|
||||||
RUN pip install --no-cache-dir -e ".[mcp]"
|
RUN pip install --no-cache-dir -e ".[mcp]"
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ async def root():
|
||||||
@app.get("/tickets", response_class=HTMLResponse, include_in_schema=False)
|
@app.get("/tickets", response_class=HTMLResponse, include_in_schema=False)
|
||||||
async def tickets_page(request: Request):
|
async def tickets_page(request: Request):
|
||||||
return templates.TemplateResponse(
|
return templates.TemplateResponse(
|
||||||
"tickets.html", {"request": request, "active_page": "tickets"}
|
request, "tickets.html", {"active_page": "tickets"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,9 +159,7 @@ def make_router(api_key: str, get_db, require_user=None) -> APIRouter:
|
||||||
return {"username": "claude", "email": "claude@internal"}
|
return {"username": "claude", "email": "claude@internal"}
|
||||||
if require_user is not None:
|
if require_user is not None:
|
||||||
return require_user(request)
|
return require_user(request)
|
||||||
if not api_key:
|
|
||||||
return {"username": "local", "email": "local@localhost"}
|
return {"username": "local", "email": "local@localhost"}
|
||||||
raise HTTPException(401, "unauthorized")
|
|
||||||
|
|
||||||
# ── Environment endpoints ─────────────────────────────────────────────────
|
# ── Environment endpoints ─────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
until pg_isready -q -h postgres; do
|
||||||
|
echo "Waiting for postgres..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
alembic upgrade head
|
alembic upgrade head
|
||||||
exec uvicorn corvid.main:app --host 0.0.0.0 --port 8080
|
exec uvicorn corvid.main:app --host 0.0.0.0 --port 8080
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,6 @@ def update_ticket(
|
||||||
user: str = "",
|
user: str = "",
|
||||||
parent_id: int = -1,
|
parent_id: int = -1,
|
||||||
effort: int = -1,
|
effort: int = -1,
|
||||||
environment_id: int = -1,
|
|
||||||
) -> dict:
|
) -> dict:
|
||||||
"""
|
"""
|
||||||
Update an existing homelab ticket. Only provided (non-empty) fields
|
Update an existing homelab ticket. Only provided (non-empty) fields
|
||||||
|
|
@ -254,8 +253,6 @@ def update_ticket(
|
||||||
Omit (default -1) to leave unchanged.
|
Omit (default -1) to leave unchanged.
|
||||||
effort: Effort rating 1–10; pass 0 to clear it.
|
effort: Effort rating 1–10; pass 0 to clear it.
|
||||||
Omit (default -1) to leave unchanged.
|
Omit (default -1) to leave unchanged.
|
||||||
environment_id: Move ticket to a different environment by ID.
|
|
||||||
Omit (default -1) to leave unchanged.
|
|
||||||
"""
|
"""
|
||||||
body = {}
|
body = {}
|
||||||
if title: body["title"] = title
|
if title: body["title"] = title
|
||||||
|
|
@ -267,8 +264,6 @@ def update_ticket(
|
||||||
body["parent_id"] = parent_id if parent_id > 0 else None
|
body["parent_id"] = parent_id if parent_id > 0 else None
|
||||||
if effort >= 0:
|
if effort >= 0:
|
||||||
body["effort"] = effort if effort > 0 else None
|
body["effort"] = effort if effort > 0 else None
|
||||||
if environment_id >= 0:
|
|
||||||
body["environment_id"] = environment_id if environment_id > 0 else None
|
|
||||||
if not body:
|
if not body:
|
||||||
raise ValueError("Provide at least one field to update")
|
raise ValueError("Provide at least one field to update")
|
||||||
with _client() as c:
|
with _client() as c:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue