fix: serialize datetime objects to string in insert method of BaseView

This commit is contained in:
retoor 2025-01-02 19:41:09 +00:00
parent d4a26d730d
commit 2043b8b4e2

View File

@ -47,7 +47,7 @@ class BaseView(web.View):
def insert(self, table, data):
data['ip'] = self.ip
data['created'] = datetime.now()
data = json.loads(json.dumps(data))
data = json.loads(json.dumps(data,default=str))
return self.db[table].insert(data)
def find(self,table,data=None):