[locations] Add weather fetching to birds and moods
This commit is contained in:
@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user