diff --git a/inventory/db.py b/inventory/db.py index 0b863a8..b1b7e2e 100644 --- a/inventory/db.py +++ b/inventory/db.py @@ -12,7 +12,6 @@ _engine = None SessionLocal = None def init_db(database_url: str, engine_kwargs: Dict[str, Any], session_kwargs: Dict[str, Any]) -> None: - print("AM I EVEN BEING RUN?!") global _engine, SessionLocal print(database_url) _engine = create_engine(database_url, **engine_kwargs) diff --git a/inventory/routes/entry.py b/inventory/routes/entry.py index 7e3acdc..a72285d 100644 --- a/inventory/routes/entry.py +++ b/inventory/routes/entry.py @@ -282,6 +282,12 @@ def init_entry_routes(app): f["label"] = "" f["label_spec"] = "New User" break + elif model == "room": + for f in fields_spec: + if f.get("name") == "label" and f.get("type") == "display": + f["label"] = "" + f["label_spec"] = "New Room" + break obj = cls() ScopedSession = current_app.extensions["crudkit"]["Session"] @@ -325,6 +331,10 @@ def init_entry_routes(app): if "work_item" in payload and "work_item_id" not in payload: payload["work_item_id"] = payload.pop("work_item") + if model == "room": + if "room_function_id" in payload and "function_id" not in payload: + payload["function_id"] = payload.pop("room_function_id") + # Parent first, no commit yet obj = svc.create(payload, actor="create_entry", commit=False) @@ -422,7 +432,6 @@ def init_entry_routes(app): return {"status": "success", "payload": payload} except Exception as e: - print(e) return {"status": "failure", "error": str(e)} app.register_blueprint(bp_entry) diff --git a/inventory/templates/base.html b/inventory/templates/base.html index 18930f9..6dfbabc 100644 --- a/inventory/templates/base.html +++ b/inventory/templates/base.html @@ -43,6 +43,11 @@ + + + diff --git a/inventory/templates/components/combobox.html b/inventory/templates/components/combobox.html index 5fb91e1..a4d3945 100644 --- a/inventory/templates/components/combobox.html +++ b/inventory/templates/components/combobox.html @@ -2,7 +2,7 @@ {% macro combobox(id, name, placeholder, items, value_attr='id', label_attr='name', add_disabled=True, remove_disabled=True, edit_disabled=True) %} -