Sarolanda commited on
Commit
40dc437
·
1 Parent(s): c60baa5

adds error treat

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. index.html +1 -0
app.py CHANGED
@@ -95,7 +95,8 @@ async def get_animal(animal_id: int):
95
  return JSONResponse(content={"error": "not found"}, status_code=404)
96
  for s in detail.get("sightings", []):
97
  s["photo_url"] = _photo_url(s.get("photo_path") or "")
98
- # also strip embedding from animal object before sending
 
99
  detail.get("animal", {}).pop("embedding", None)
100
  return JSONResponse(content=detail)
101
 
 
95
  return JSONResponse(content={"error": "not found"}, status_code=404)
96
  for s in detail.get("sightings", []):
97
  s["photo_url"] = _photo_url(s.get("photo_path") or "")
98
+ for h in detail.get("help_events", []):
99
+ h["photo_url"] = _photo_url(h.get("photo_path") or "")
100
  detail.get("animal", {}).pop("embedding", None)
101
  return JSONResponse(content=detail)
102
 
index.html CHANGED
@@ -704,6 +704,7 @@
704
 
705
  async function openProfile(id) {
706
  profileAnimalId = id;
 
707
  showScreen('profile');
708
 
709
  // Reset
 
704
 
705
  async function openProfile(id) {
706
  profileAnimalId = id;
707
+ window.profileAnimalId = id;
708
  showScreen('profile');
709
 
710
  // Reset