From 4230e2af6a76cb6c788b9b234b5a501c9762b0c5 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 17 Dec 2025 16:32:22 +0000 Subject: [PATCH] Filter out non-constraint keys in rota detail view for improved data presentation --- djangorota/rota/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/djangorota/rota/views.py b/djangorota/rota/views.py index 29df807..512a795 100644 --- a/djangorota/rota/views.py +++ b/djangorota/rota/views.py @@ -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)