fixed deleting object date time

This commit is contained in:
ArabCoders 2023-11-27 15:55:01 +03:00
parent 76df54ba1a
commit d199ef6a56

View file

@ -92,7 +92,13 @@ class DataStore:
VALUES (?, ?, ?, ?)
ON CONFLICT DO UPDATE SET "type" = ?, "url" = ?, "data" = ?
"""
delattr(item, 'datetime')
if hasattr(item, 'datetime'):
try:
delattr(item, 'datetime')
except AttributeError:
pass
with sqlite3.connect(self.db_file) as db:
db.execute(sqlStatement.strip(), (
item._id,