Skip to content

Commit 193d149

Browse files
authored
Merge pull request #5 from pyobs/develop
v1.1.3
2 parents 08c212d + bc45018 commit 193d149

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pyobs_weather/api/views.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,12 @@ def good_weather(request):
239239
changes = [{'time': g.time, 'good': g.good}
240240
for g in GoodWeather.objects.filter(time__gt=datetime.utcnow() - timedelta(days=1)).all()]
241241

242+
# if None, return last one
243+
if len(changes) == 0:
244+
last = GoodWeather.objects.last()
245+
if last is not None:
246+
changes = [{'time': last.time, 'good': last.good}]
247+
242248
# get location
243249
location = EarthLocation(lon=settings.OBSERVER_LOCATION['longitude'] * u.deg,
244250
lat=settings.OBSERVER_LOCATION['latitude'] * u.deg,

pyobs_weather/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.1.2'
1+
VERSION = '1.1.3'

0 commit comments

Comments
 (0)