Viktor Kartashov commited on
Commit ·
e8dd29b
1
Parent(s): 3190623
fix: deliverable flag read when encoded as a string
Browse files- api/evidence.py +7 -2
api/evidence.py
CHANGED
|
@@ -157,7 +157,6 @@ def create_attestation():
|
|
| 157 |
attestation.context_type = context_type
|
| 158 |
attestation.tool = context.get('tool')
|
| 159 |
attestation.sig_status = 'unsigned'
|
| 160 |
-
attestation.deliverable = context.get('deliverable', False)
|
| 161 |
attestation.product_key = product_key
|
| 162 |
attestation.product_version = product_version
|
| 163 |
attestation.labels = labels
|
|
@@ -170,7 +169,13 @@ def create_attestation():
|
|
| 170 |
attestation.job_ids = context.get('job_ids', [])
|
| 171 |
attestation.pipeline_run = context.get('pipeline_run')
|
| 172 |
attestation.upload_pending = True # Mark as pending upload
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
db.session.add(attestation)
|
| 175 |
db.session.flush() # Get the ID without committing
|
| 176 |
|
|
|
|
| 157 |
attestation.context_type = context_type
|
| 158 |
attestation.tool = context.get('tool')
|
| 159 |
attestation.sig_status = 'unsigned'
|
|
|
|
| 160 |
attestation.product_key = product_key
|
| 161 |
attestation.product_version = product_version
|
| 162 |
attestation.labels = labels
|
|
|
|
| 169 |
attestation.job_ids = context.get('job_ids', [])
|
| 170 |
attestation.pipeline_run = context.get('pipeline_run')
|
| 171 |
attestation.upload_pending = True # Mark as pending upload
|
| 172 |
+
|
| 173 |
+
deliverable_value = context.get('deliverable', False)
|
| 174 |
+
if isinstance(deliverable_value, str):
|
| 175 |
+
attestation.deliverable = deliverable_value.lower() == "true"
|
| 176 |
+
else:
|
| 177 |
+
attestation.deliverable = bool(deliverable_value)
|
| 178 |
+
|
| 179 |
db.session.add(attestation)
|
| 180 |
db.session.flush() # Get the ID without committing
|
| 181 |
|