Skip to content

Commit

Permalink
Use datetime objects instead of strings when creating Freshmaker even…
Browse files Browse the repository at this point in the history
…ts in the scraper
  • Loading branch information
mprahl committed Jul 15, 2019
1 parent fde2784 commit 429f235
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scrapers/freshmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def query_api_and_update_neo4j(self):
state_reason=fm_event['state_reason'],
url=fm_event['url']
)
if 'time_created' in fm_event:
event_params['time_created'] = fm_event['time_created']
if 'time_done' in fm_event:
event_params['time_done'] = fm_event['time_created']
if fm_event.get('time_created'):
event_params['time_created'] = timestamp_to_datetime(fm_event['time_created'])
if fm_event.get('time_done'):
event_params['time_done'] = timestamp_to_datetime(fm_event['time_created'])
event = FreshmakerEvent.create_or_update(event_params)[0]

log.debug('Creating Advisory {0}'.format(fm_event['search_key']))
Expand Down

0 comments on commit 429f235

Please sign in to comment.