Skip to content

Commit

Permalink
Making default start date yesterday for Withings historical fetch whe…
Browse files Browse the repository at this point in the history
…n no start has been provided.
  • Loading branch information
audaciouscode committed Jul 20, 2017
1 parent ba4057f commit 74aa101
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions management/commands/fetch_historical_withings_data.py
Expand Up @@ -39,12 +39,12 @@ def handle(self, *args, **options): # pylint: disable=too-many-locals,too-many-b

start = options['start']
if start is None:
start = timezone.now().strftime('%Y-%m-%d')
start = (timezone.now() - datetime.timedelta(days=1)).strftime('%Y-%m-%d')

end = options['end']

if end is None:
end = (timezone.now() + datetime.timedelta(days=1)).strftime('%Y-%m-%d')
end = timezone.now().strftime('%Y-%m-%d')

start_date = arrow.get(start).replace(hour=0, minute=0, second=0).to(settings.TIME_ZONE)
end_date = arrow.get(end).replace(hour=0, minute=0, second=0).to(settings.TIME_ZONE)
Expand Down

0 comments on commit 74aa101

Please sign in to comment.