Spaces:
Sleeping
Sleeping
Fix IndentationError line 50: Add missing consent_events_sample declaration and correct indentation
Browse filesROOT CAUSE:
Line 50 had IndentationError because the dictionary literal { started with unexpected indentation without a proper variable assignment statement.
FIXES APPLIED:
1. Added consent_events_sample = [ on line 49 (column 0 - module level)
2. Corrected line 50 indentation to exactly 4 spaces (proper list item indentation)
This fix aligns with Python PEP 8 indentation standards and Gradio Blocks API requirements where data variables must be declared before the with gr.Blocks() context.
app.py
CHANGED
|
@@ -46,8 +46,8 @@ def audit_trail_widget(audit_history: List[Dict[str, Any]]):
|
|
| 46 |
audit_log += f"{item.get('contact_id','?')},{item.get('event_type','?')},{item.get('opt_out',False)},{item.get('compliance_flag','?')}\n"
|
| 47 |
return gr.Textbox(label="Audit Trail CSV", value=audit_log, lines=10)
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
"contact_id": "LEAD_001",
|
| 52 |
"event_type": "consent_given",
|
| 53 |
"timestamp": "2025-11-06T06:20:00Z",
|
|
|
|
| 46 |
audit_log += f"{item.get('contact_id','?')},{item.get('event_type','?')},{item.get('opt_out',False)},{item.get('compliance_flag','?')}\n"
|
| 47 |
return gr.Textbox(label="Audit Trail CSV", value=audit_log, lines=10)
|
| 48 |
|
| 49 |
+
consent_events_sample = [
|
| 50 |
+
{
|
| 51 |
"contact_id": "LEAD_001",
|
| 52 |
"event_type": "consent_given",
|
| 53 |
"timestamp": "2025-11-06T06:20:00Z",
|