Parcourir la source

Time ranges fix

Hal De il y a 4 ans
Parent
commit
0fef764df0
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      app/app.py

+ 4 - 4
app/app.py

@@ -140,7 +140,7 @@ async def getCDR(start=None, end=None, **kwargs):
   if end is None:
     end = dt.now()
   if start is None:
-    start=(end - td(days=30))
+    start=(end - td(hours=24))
   async for row in db.iterate(query='''SELECT linkedid,
                                               uniqueid,
                                               calldate,
@@ -179,7 +179,7 @@ async def getCEL(start=None, end=None, **kwargs):
   if end is None:
     end = dt.now()
   if start is None:
-    start=(end - td(days=30))
+    start=(end - td(hours=24))
   async for row in db.iterate(query='''SELECT linkedid,
                                               uniqueid,
                                               eventtime,
@@ -756,7 +756,7 @@ class DeviceUnBind(Resource):
 @app.route('/cdr')
 class CDR(Resource):
   @app.param('end', 'End of datetime range. Defaults to now. Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
-  @app.param('start', 'Start of datetime range. Defaults to (start-30 days). Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
+  @app.param('start', 'Start of datetime range. Defaults to end-24h. Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
   @app.response(HTTPStatus.OK, 'JSON reply')
   @app.response(HTTPStatus.UNAUTHORIZED, 'Authorization required')
   async def get(self):
@@ -771,7 +771,7 @@ class CDR(Resource):
 @app.route('/cel')
 class CEL(Resource):
   @app.param('end', 'End of datetime range. Defaults to now. Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
-  @app.param('start', 'Start of datetime range. Defaults to (start-30 days). Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
+  @app.param('start', 'Start of datetime range. Defaults to end-24h. Allowed formats are: timestamp, ISO 8601 and ddmmyyyyHHMMSS', 'query')
   @app.response(HTTPStatus.OK, 'JSON reply')
   @app.response(HTTPStatus.UNAUTHORIZED, 'Authorization required')
   async def get(self):