Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,14 +35,13 @@ def process_image(image):
|
|
| 35 |
"Captured_Weight__c": float(weight.replace("kg", "").strip()),
|
| 36 |
"Captured_At__c": datetime.now(ist).isoformat(),
|
| 37 |
"Device_ID__c": "DEVICE-001",
|
| 38 |
-
"Status__c": "
|
| 39 |
})
|
| 40 |
|
| 41 |
# Upload image as ContentVersion
|
| 42 |
with open(image_path, "rb") as f:
|
| 43 |
encoded_image = base64.b64encode(f.read()).decode("utf-8")
|
| 44 |
|
| 45 |
-
# Create ContentVersion
|
| 46 |
content = sf.ContentVersion.create({
|
| 47 |
"Title": f"Snapshot_{timestamp}",
|
| 48 |
"PathOnClient": "snapshot.jpg",
|
|
|
|
| 35 |
"Captured_Weight__c": float(weight.replace("kg", "").strip()),
|
| 36 |
"Captured_At__c": datetime.now(ist).isoformat(),
|
| 37 |
"Device_ID__c": "DEVICE-001",
|
| 38 |
+
"Status__c": "Confirmed" # β
Must match picklist values
|
| 39 |
})
|
| 40 |
|
| 41 |
# Upload image as ContentVersion
|
| 42 |
with open(image_path, "rb") as f:
|
| 43 |
encoded_image = base64.b64encode(f.read()).decode("utf-8")
|
| 44 |
|
|
|
|
| 45 |
content = sf.ContentVersion.create({
|
| 46 |
"Title": f"Snapshot_{timestamp}",
|
| 47 |
"PathOnClient": "snapshot.jpg",
|