Filter out non-constraint keys in rota detail view for improved data presentation

This commit is contained in:
Ross
2025-12-17 16:32:22 +00:00
parent e2c3eecc63
commit 4230e2af6a
+4
View File
@@ -164,6 +164,10 @@ def rota_detail(request, rota_id):
try:
opts = rota.options or {}
for k, v in opts.items():
# Only surface keys that correspond to the typed RotaConstraintOptions
# (exclude builder/constructor args and other non-constraint keys).
if k not in available_constraints_rich:
continue
# pretty-print complex values where appropriate
try:
pretty = json.dumps(v, indent=2, default=str)