[locations] Add weather fetching to birds and moods
All checks were successful
build & deploy / test (push) Successful in 1m49s
build & deploy / build-and-deploy (push) Successful in 30s

This commit is contained in:
2026-05-20 13:19:54 -04:00
parent c7850878fe
commit 3014a30616
7 changed files with 105 additions and 86 deletions

View File

@ -5,7 +5,6 @@ from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils import timezone
from moods.models import Mood, MoodLogData, MoodQuality, MoodReason
from moods.utils import fetch_current_weather
from scrobbles.models import Scrobble
logger = logging.getLogger(__name__)
@ -78,10 +77,7 @@ def checkin(request):
.first()
)
if last_loc and last_loc.geo_location:
weather = fetch_current_weather(
last_loc.geo_location.lat,
last_loc.geo_location.lon,
)
weather = last_loc.geo_location.current_weather
if weather:
log_data.weather_temp = weather["temp"]
log_data.weather_description = weather["description"]