From bafe699f3da189a550c847ce405587d5aa4e5b1a Mon Sep 17 00:00:00 2001 From: Chris Lenk Date: Thu, 15 Apr 2021 20:51:27 -0400 Subject: [PATCH] Fix sighting.last_seen check It is allowed to be equal to first_seen --- stix2/v21/sdo.py | 2 +- stix2/v21/sro.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stix2/v21/sdo.py b/stix2/v21/sdo.py index 35a878e9..3387c0fa 100644 --- a/stix2/v21/sdo.py +++ b/stix2/v21/sdo.py @@ -83,7 +83,7 @@ def _check_object_constraints(self): last_seen = self.get('last_seen') if first_seen and last_seen and last_seen < first_seen: - msg = "{0.id} 'last_seen' must be greater than or equal 'first_seen'" + msg = "{0.id} 'last_seen' must be greater than or equal to 'first_seen'" raise ValueError(msg.format(self)) diff --git a/stix2/v21/sro.py b/stix2/v21/sro.py index e6eada6c..9a9bcb8c 100644 --- a/stix2/v21/sro.py +++ b/stix2/v21/sro.py @@ -111,6 +111,6 @@ def _check_object_constraints(self): first_seen = self.get('first_seen') last_seen = self.get('last_seen') - if first_seen and last_seen and last_seen <= first_seen: - msg = "{0.id} 'last_seen' must be later than 'first_seen'" + if first_seen and last_seen and last_seen < first_seen: + msg = "{0.id} 'last_seen' must be greater than or equal to 'first_seen'" raise ValueError(msg.format(self))