1
0
Fork 0

Fix export last week bug

As reported in #433 there was a bug causing export requests for the last week to be treated as a last month export.

Fixes #433 by treating the period variable as the int that it is. Also makes the preceding check a little easier to understand by being explicit against the None case. 

Signed-off-by: Corey Shields <cshields@gmail.com>
spacecruft
Corey Shields 2020-10-11 08:57:07 -04:00
parent 08cd629c05
commit a653f0697c
1 changed files with 2 additions and 2 deletions

View File

@ -147,8 +147,8 @@ def export_frames(norad, user_id, period=None):
exported_frameset.satellite = Satellite.objects.get(norad_cat_id=norad)
exported_frameset.end = datetime.utcnow()
if period:
if period == '1':
if period is not None:
if period == 1:
exported_frameset.start = make_aware(exported_frameset.end - timedelta(days=7))
suffix = 'week'
else: