better filenames for statssnapshot
@@ -19,8 +19,10 @@ class Command(BaseCommand):
def handle(self, *args, **options):
result = stats_snapshot(reset=options['reset'])
if options['save']:
- filename = os.path.join(settings.STATS_ROOT,
- 'stats_%s_%s.json' % (result['start_date'], result['end_date']))
+ filename = os.path.join(
+ settings.STATS_ROOT,
+ 'stats__%s__%s.json' % (result['start_date'], result['end_date'])
+ ).replace(' ', '_').replace(':', '-')
json.dump(result, open(filename, 'w'), indent=4)
print('saved to %s' % filename)
else:
