Skip to content

Commit

Permalink
Make data suspicious if its datetime year is to old
Browse files Browse the repository at this point in the history
Perhaps also add check for events from the place known as the future
  • Loading branch information
Arne de Laat committed Apr 17, 2013
1 parent 19068d3 commit 6b0bdcf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wsgi/wsgi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ def store_data(station_id, cluster, event_list):
tmp_dir = os.path.join(config.get('General', 'data_dir'), 'tmp')

if is_data_suspicious(event_list):
dir = os.path.join(config.get('General', 'data_dir'),
'suspicious')
dir = os.path.join(config.get('General', 'data_dir'), 'suspicious')

file = tempfile.NamedTemporaryFile(dir=tmp_dir, delete=False)
data = {'station_id': station_id, 'cluster': cluster,
Expand All @@ -157,6 +156,6 @@ def is_data_suspicious(event_list):
"""
for event in event_list:
if event['header']['datetime'].year == 2008:
if event['header']['datetime'].year < 2013:
return True
return False

0 comments on commit 6b0bdcf

Please sign in to comment.