diff --git a/opentaxii/persistence/sqldb/api.py b/opentaxii/persistence/sqldb/api.py index 4ce29538..5779ef64 100644 --- a/opentaxii/persistence/sqldb/api.py +++ b/opentaxii/persistence/sqldb/api.py @@ -983,6 +983,8 @@ def add_objects( self.db.session.commit() job_details = [] for obj in objects: + if not obj.get("modified"): + obj["modified"] = obj.get("created") or datetime.datetime.now(datetime.timezone.utc).strftime(DATETIMEFORMAT) version = datetime.datetime.strptime( obj["modified"], DATETIMEFORMAT ).replace(tzinfo=datetime.timezone.utc)