Filter out non-constraint keys in rota detail view for improved data presentation
This commit is contained in:
@@ -164,6 +164,10 @@ def rota_detail(request, rota_id):
|
|||||||
try:
|
try:
|
||||||
opts = rota.options or {}
|
opts = rota.options or {}
|
||||||
for k, v in opts.items():
|
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
|
# pretty-print complex values where appropriate
|
||||||
try:
|
try:
|
||||||
pretty = json.dumps(v, indent=2, default=str)
|
pretty = json.dumps(v, indent=2, default=str)
|
||||||
|
|||||||
Reference in New Issue
Block a user