Spaces:
Running
Running
fix: compliance.py — NOT_APPLICABLE regulation rendering
Browse files- compliance.py +22 -0
compliance.py
CHANGED
|
@@ -379,6 +379,28 @@ def render_compliance_html(results):
|
|
| 379 |
rate = reg_result["compliance_rate"]
|
| 380 |
status = reg_result["overall_status"]
|
| 381 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
status_colors = {
|
| 383 |
"COMPLIANT": ("#16a34a", "#f0fdf4"),
|
| 384 |
"PARTIAL": ("#ca8a04", "#fefce8"),
|
|
|
|
| 379 |
rate = reg_result["compliance_rate"]
|
| 380 |
status = reg_result["overall_status"]
|
| 381 |
|
| 382 |
+
# FIX v4.3: Handle NOT_APPLICABLE regulations
|
| 383 |
+
if status == "NOT_APPLICABLE":
|
| 384 |
+
note = reg_result.get("note", f"{reg_name} not applicable to this contract.")
|
| 385 |
+
html += f'''
|
| 386 |
+
<div style="border:1px solid #e5e7eb;border-radius:10px;margin-bottom:16px;overflow:hidden;opacity:0.6;">
|
| 387 |
+
<div style="display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#f9fafb;border-bottom:1px solid #e5e7eb;">
|
| 388 |
+
<div>
|
| 389 |
+
<span style="font-size:16px;font-weight:700;color:#9ca3af;">{reg_name}</span>
|
| 390 |
+
<p style="font-size:11px;color:#9ca3af;margin:2px 0 0 0;">{reg_result["description"]}</p>
|
| 391 |
+
</div>
|
| 392 |
+
<div style="text-align:right;">
|
| 393 |
+
<div style="font-size:12px;font-weight:600;color:#9ca3af;">N/A</div>
|
| 394 |
+
<div style="font-size:10px;color:#9ca3af;">Not Applicable</div>
|
| 395 |
+
</div>
|
| 396 |
+
</div>
|
| 397 |
+
<div style="padding:10px 16px;font-size:11px;color:#9ca3af;font-style:italic;">
|
| 398 |
+
{note}
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
'''
|
| 402 |
+
continue
|
| 403 |
+
|
| 404 |
status_colors = {
|
| 405 |
"COMPLIANT": ("#16a34a", "#f0fdf4"),
|
| 406 |
"PARTIAL": ("#ca8a04", "#fefce8"),
|