contract 0.17.0: expose DashboardDefault to plugins

The enforcement reports needed to name what a display IS, and reached
straight into shopdb.core.models.dashboarddefault to do it. Plugins may
only touch core through shopdb.api, and the contract test said so.

The role belongs on the surface rather than behind it: it lives in core,
no plugin owns it, and a plugin reporting on displays has no other way to
resolve it. Added there and the version bumped, which the docs test pins.
This commit is contained in:
cproudlock
2026-08-12 16:41:09 -04:00
parent 598c2c98bc
commit 52eb10f5ca
4 changed files with 7 additions and 6 deletions

View File

@@ -1014,10 +1014,7 @@ def _attach_display_roles(facts, hostnames):
ShopDB's mirror of the display-type.txt each kiosk reads at startup.
"""
try:
from shopdb.core.models.dashboarddefault import DashboardDefault
except ImportError:
return
from shopdb.api import DashboardDefault
lowered = {name.lower() for name in hostnames}
for default in DashboardDefault.query.filter_by(isactive=True).all():
host = (default.fqdn or '').split('.')[0].lower()