Fix sighting.last_seen check

It is allowed to be equal to first_seen
pull/1/head
Chris Lenk 2021-04-15 20:51:27 -04:00
parent 2743b90fc0
commit bafe699f3d
2 changed files with 3 additions and 3 deletions

View File

@ -83,7 +83,7 @@ class Campaign(_DomainObject):
last_seen = self.get('last_seen') last_seen = self.get('last_seen')
if first_seen and last_seen and last_seen < first_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)) raise ValueError(msg.format(self))

View File

@ -111,6 +111,6 @@ class Sighting(_RelationshipObject):
first_seen = self.get('first_seen') first_seen = self.get('first_seen')
last_seen = self.get('last_seen') last_seen = self.get('last_seen')
if first_seen and last_seen and last_seen <= first_seen: if first_seen and last_seen and last_seen < first_seen:
msg = "{0.id} 'last_seen' must be later than 'first_seen'" msg = "{0.id} 'last_seen' must be greater than or equal to 'first_seen'"
raise ValueError(msg.format(self)) raise ValueError(msg.format(self))