From 2c7ffa8ee029d613f7135ada322cd66b4d4340fe Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 14 Feb 2026 13:31:47 -0600 Subject: [PATCH] bug: fixed issue of label showing [title] tag --- modules/conssheets/routes.py | 20 +++++++++++++++---- .../templates/conssheets/staff_index.html | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/conssheets/routes.py b/modules/conssheets/routes.py index c97556b..90b5f3e 100644 --- a/modules/conssheets/routes.py +++ b/modules/conssheets/routes.py @@ -750,13 +750,19 @@ def register_routes(bp): flash('Process not found', 'danger') return redirect(url_for('conssheets.index')) - # Get header fields for this process - header_fields = query_db(''' + # Get header fields for this process, stripping [title] prefix + header_fields_raw = query_db(''' SELECT * FROM cons_process_fields WHERE process_id = ? AND table_type = 'header' AND is_active = 1 ORDER BY sort_order, id ''', [process_id]) + header_fields = [] + for hf in header_fields_raw: + hf_dict = dict(hf) + hf_dict['field_label'] = strip_title_prefix(hf_dict['field_label']) + header_fields.append(hf_dict) + if request.method == 'POST': # Validate required fields missing_required = [] @@ -816,13 +822,19 @@ def register_routes(bp): flash('Permission denied', 'danger') return redirect(url_for('conssheets.index')) - # Get header fields - header_fields = query_db(''' + # Get header fields for this process, stripping [title] prefix + header_fields_raw = query_db(''' SELECT * FROM cons_process_fields WHERE process_id = ? AND table_type = 'header' AND is_active = 1 ORDER BY sort_order, id ''', [sess['process_id']]) + header_fields = [] + for hf in header_fields_raw: + hf_dict = dict(hf) + hf_dict['field_label'] = strip_title_prefix(hf_dict['field_label']) + header_fields.append(hf_dict) + # Get existing values existing_values = query_db(''' SELECT cpf.field_name, cshv.field_value diff --git a/modules/conssheets/templates/conssheets/staff_index.html b/modules/conssheets/templates/conssheets/staff_index.html index 05a5784..0af5269 100644 --- a/modules/conssheets/templates/conssheets/staff_index.html +++ b/modules/conssheets/templates/conssheets/staff_index.html @@ -46,7 +46,7 @@
Started: {{ s.created_at[:16] }} - {{ s.scan_count or 0 }} lots scanned + {{ s.scan_count or 0 }} Scanned
{% if s.header_preview %}