From 4b548df2f7241082a973c866ae33829b07680f7f Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Thu, 20 Jan 2022 09:57:15 -0300 Subject: [PATCH] Fixing the registrar_exec method. --- api/dataapi/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/dataapi/cli.py b/api/dataapi/cli.py index 3be0bb6..c7b9bfe 100644 --- a/api/dataapi/cli.py +++ b/api/dataapi/cli.py @@ -1,6 +1,5 @@ from datetime import datetime import json -from time import time import requests @@ -85,10 +84,12 @@ class DataAPI: --- """ + today_date = datetime.now().isoformat()[:10] + table_check = self.do({ "Col": register_table, "Op": "R", - "Q": f"@[?date=='{datetime.now().isoformat()}']" + "Q": f"@[?date=='{today_date}']" }) if len(table_check["data"]) > 0: @@ -138,7 +139,7 @@ class DataAPI: "Col": register_table, "Op": "C", "Data": { - "date": datetime.now().isoformat(), + "date": today_date, "exec": success, "err": fail, }