diff --git a/stand/api.py b/stand/api.py index afd00ea..54c0654 100644 --- a/stand/api.py +++ b/stand/api.py @@ -1,4 +1,5 @@ from datetime import datetime +from http import HTTPStatus from typing import Any import pandas as pd @@ -20,7 +21,7 @@ def append(beamline: Beamline, pgroup: PGroup, run: int, row: dict[str, Any]): run_exists = not lib.read(pgroup, date_range=index, columns=[]).data.index.empty if run_exists: - raise HTTPException(409, f"run {run} exists already in {beamline}/{pgroup}") + raise HTTPException(HTTPStatus.CONFLICT, f"run {run} exists already in {beamline}/{pgroup}") timestamp = row.pop("timestamp", None) timestamp = datetime.fromisoformat(timestamp) if timestamp else datetime.now()