Hide inactive merged services from service catalogue

This commit is contained in:
A R R R Associates
2026-07-17 23:20:08 +05:30
parent 0b58bf182b
commit e219a0800c
4 changed files with 42 additions and 8 deletions
+2
View File
@@ -44,6 +44,8 @@ def build_merge_preview(db: Session, *, source_id: int, target_id: int) -> Merge
target = db.get(ServiceCatalogue, target_id)
if not source or not target:
raise ValueError("The selected source or target service no longer exists.")
if not source.is_active or not target.is_active:
raise ValueError("Only active services can be selected for a merge.")
counts = {
"firm_selections": _count(db, FirmServiceSelection, FirmServiceSelection.service_catalogue_id == source_id),