fix(prospecting): resolve all architecture validator warnings
Some checks failed
Some checks failed
- MDL-003: use Pydantic v2 ConfigDict in PerformanceProfileResponse - EXC-003: suppress broad except in enrichment_service (external HTTP scanning) - FE-004: suppress inline modal warnings in templates with noqa comments - FE-008: suppress score filter number input warning in leads.html - SVC-005: suppress store_id scoping for platform-level prospecting queries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -157,7 +157,7 @@ class EnrichmentService:
|
||||
not_after = cert.get("notAfter")
|
||||
if not_after:
|
||||
cert_expires_at = datetime.strptime(not_after, "%b %d %H:%M:%S %Y %Z")
|
||||
except Exception:
|
||||
except Exception: # noqa: EXC003
|
||||
has_valid_cert = False
|
||||
|
||||
# Upsert tech profile
|
||||
@@ -180,7 +180,7 @@ class EnrichmentService:
|
||||
db.flush()
|
||||
return profile
|
||||
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: EXC003
|
||||
logger.error("Tech scan failed for %s: %s", domain, e)
|
||||
if prospect.tech_profile:
|
||||
prospect.tech_profile.scan_error = str(e)
|
||||
@@ -254,7 +254,7 @@ class EnrichmentService:
|
||||
db.flush()
|
||||
return profile
|
||||
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: EXC003
|
||||
logger.error("Performance scan failed for %s: %s", domain, e)
|
||||
prospect.last_perf_scan_at = datetime.now(UTC)
|
||||
db.flush()
|
||||
@@ -313,7 +313,7 @@ class EnrichmentService:
|
||||
source_url=url,
|
||||
source_element="regex",
|
||||
))
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: EXC003
|
||||
logger.debug("Contact scrape failed for %s%s: %s", domain, path, e)
|
||||
|
||||
session.close()
|
||||
|
||||
@@ -222,7 +222,7 @@ class ProspectService:
|
||||
)
|
||||
|
||||
def count_by_status(self, db: Session) -> dict[str, int]:
|
||||
results = db.query(Prospect.status, func.count(Prospect.id)).group_by(Prospect.status).all()
|
||||
results = db.query(Prospect.status, func.count(Prospect.id)).group_by(Prospect.status).all() # noqa: SVC-005 - prospecting is platform-scoped, not store-scoped
|
||||
return {status.value if hasattr(status, "value") else str(status): count for status, count in results}
|
||||
|
||||
def count_by_channel(self, db: Session) -> dict[str, int]:
|
||||
|
||||
@@ -80,7 +80,7 @@ class StatsService:
|
||||
|
||||
def _get_common_issues(self, db: Session) -> list[dict]:
|
||||
"""Extract common issue flags from scored prospects."""
|
||||
scores = db.query(ProspectScore.reason_flags).filter(ProspectScore.reason_flags.isnot(None)).all()
|
||||
scores = db.query(ProspectScore.reason_flags).filter(ProspectScore.reason_flags.isnot(None)).all() # noqa: SVC-005 - prospecting is platform-scoped, not store-scoped
|
||||
|
||||
import json
|
||||
flag_counts: dict[str, int] = {}
|
||||
|
||||
Reference in New Issue
Block a user