fix: reopen clears restored_at, wire settings, docs, startup warning

This commit is contained in:
Atharv1705
2026-11-12 17:34:04 +05:30
parent 5027c0766e
commit e2a6fa601e
17 changed files with 292 additions and 36 deletions
+4 -1
View File
@@ -12,6 +12,7 @@ from sqlalchemy.orm import Session
from ..core.exceptions import CodedHTTPException
from ..models import Asset, Category, Department, Location, Vendor
from .audit import log_audit
from .settings_service import get_setting_value
IMPORT_COLUMNS = [
"asset_code",
@@ -93,8 +94,10 @@ def build_import_template_xlsx(db: Session) -> BytesIO:
sample_cat = categories[0] if categories else None
sample_sup = vendors[0] if vendors else None
sample_prefix = str(get_setting_value(db, "asset_code_prefix", "PHRC")).strip() or "PHRC"
sample_dept_code = sample_dept.code if sample_dept else "ICU"
sample_row = [
"PHRC-ICU-0901",
f"{sample_prefix}-{sample_dept_code}-0901",
"SN-DEMO-901",
"Infusion Pump",
sample_cat.name if sample_cat else "Infusion Pump",