mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Further alert implementation #17
This commit is contained in:
@@ -33,7 +33,9 @@ class POTA(HTTPAlertProvider):
|
||||
end_time=datetime.strptime(source_alert["endDate"] + source_alert["endTime"],
|
||||
"%Y-%m-%d%H:%M").replace(tzinfo=pytz.UTC).timestamp())
|
||||
|
||||
# Add to our list. Don't worry about de-duping, removing old alerts etc. at this point; other code will do
|
||||
# Add to our list, but exclude any old spots that POTA can sometimes give us where even the end time is
|
||||
# in the past. Don't worry about de-duping, removing old alerts etc. at this point; other code will do
|
||||
# that for us.
|
||||
new_alerts.append(alert)
|
||||
if alert.end_time > datetime.now(pytz.UTC).timestamp():
|
||||
new_alerts.append(alert)
|
||||
return new_alerts
|
||||
|
||||
Reference in New Issue
Block a user