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
parent
08cd629c05
commit
a653f0697c
|
@ -147,8 +147,8 @@ def export_frames(norad, user_id, period=None):
|
||||||
exported_frameset.satellite = Satellite.objects.get(norad_cat_id=norad)
|
exported_frameset.satellite = Satellite.objects.get(norad_cat_id=norad)
|
||||||
exported_frameset.end = datetime.utcnow()
|
exported_frameset.end = datetime.utcnow()
|
||||||
|
|
||||||
if period:
|
if period is not None:
|
||||||
if period == '1':
|
if period == 1:
|
||||||
exported_frameset.start = make_aware(exported_frameset.end - timedelta(days=7))
|
exported_frameset.start = make_aware(exported_frameset.end - timedelta(days=7))
|
||||||
suffix = 'week'
|
suffix = 'week'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue