We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 08c212d + bc45018 commit 193d149Copy full SHA for 193d149
pyobs_weather/api/views.py
@@ -239,6 +239,12 @@ def good_weather(request):
239
changes = [{'time': g.time, 'good': g.good}
240
for g in GoodWeather.objects.filter(time__gt=datetime.utcnow() - timedelta(days=1)).all()]
241
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
+
248
# get location
249
location = EarthLocation(lon=settings.OBSERVER_LOCATION['longitude'] * u.deg,
250
lat=settings.OBSERVER_LOCATION['latitude'] * u.deg,
pyobs_weather/version.py
@@ -1 +1 @@
1
-VERSION = '1.1.2'
+VERSION = '1.1.3'
0 commit comments