Madiwka3 vor 1 Jahr
Ursprung
Commit
44405f2cea
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen
  1. +8
    -0
      app/apis/v1/route_maintenancejob.py
  2. +1
    -1
      app/db/repository/maintenancejob.py

+ 8
- 0
app/apis/v1/route_maintenancejob.py Datei anzeigen

@@ -103,4 +103,12 @@ def change_status(
result = change_maintenance_status(maintenance_job_id, status, current_user.Id, db)
if result is None:
raise HTTPException(status_code=404, detail="Maintenance job not found")
if result == "alreadydone":
raise HTTPException(
status_code=400, detail="This maintenance job is already done"
)
if result == "invalidstatus":
raise HTTPException(
status_code=400, detail="Invalid status, please use 'Complete'"
)
return result

+ 1
- 1
app/db/repository/maintenancejob.py Datei anzeigen

@@ -121,4 +121,4 @@ def change_maintenance_status(
db.refresh(maintenancejob)
return maintenancejob
else:
return None
return "invalidstatus"

Laden…
Abbrechen
Speichern