Spaces:
Sleeping
Sleeping
add City field
Browse files
app.py
CHANGED
|
@@ -275,6 +275,8 @@ async def upload_image(
|
|
| 275 |
validation_response = supabase.table("validation").select("location_text").execute()
|
| 276 |
approved_locations = {item['location_text'] for item in validation_response.data}
|
| 277 |
is_approved = 1 if location in approved_locations else 0
|
|
|
|
|
|
|
| 278 |
insert_data = {
|
| 279 |
"guid": guid,
|
| 280 |
"image_name": file.filename,
|
|
@@ -287,7 +289,7 @@ async def upload_image(
|
|
| 287 |
"variance": getvariancevalue,
|
| 288 |
"city": city
|
| 289 |
}
|
| 290 |
-
|
| 291 |
response = supabase.table("potholes").insert(insert_data).execute()
|
| 292 |
except Exception as e:
|
| 293 |
raise HTTPException(status_code=500, detail=f"Database Error: {str(e)}")
|
|
|
|
| 275 |
validation_response = supabase.table("validation").select("location_text").execute()
|
| 276 |
approved_locations = {item['location_text'] for item in validation_response.data}
|
| 277 |
is_approved = 1 if location in approved_locations else 0
|
| 278 |
+
print(f"category: {category}")
|
| 279 |
+
print(f"city value: {city}")
|
| 280 |
insert_data = {
|
| 281 |
"guid": guid,
|
| 282 |
"image_name": file.filename,
|
|
|
|
| 289 |
"variance": getvariancevalue,
|
| 290 |
"city": city
|
| 291 |
}
|
| 292 |
+
|
| 293 |
response = supabase.table("potholes").insert(insert_data).execute()
|
| 294 |
except Exception as e:
|
| 295 |
raise HTTPException(status_code=500, detail=f"Database Error: {str(e)}")
|