Skip to content

Commit

Permalink
Resolve time format conflicts between ingested data and STIX object t…
Browse files Browse the repository at this point in the history
…imestamps
  • Loading branch information
“meet.ghodasara” committed Nov 6, 2024
1 parent 855bb45 commit 2407fca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions opentaxii/persistence/sqldb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2407fca

Please sign in to comment.