fix: [ocr] fix None copy date

This commit is contained in:
terrtia 2024-04-25 14:29:30 +02:00
parent 20c98de0fa
commit 42ef6fb2e5
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -133,7 +133,8 @@ class AbstractDaterangeObject(AbstractObject, ABC):
if first_seen and last_seen: if first_seen and last_seen:
for date in Date.get_daterange(first_seen, last_seen): for date in Date.get_daterange(first_seen, last_seen):
nb = r_object.zscore(f'{obj_type}:date:{date}', self.id) nb = r_object.zscore(f'{obj_type}:date:{date}', self.id)
r_object.zincrby(f'{self.type}:date:{date}', nb, self.id) if nb:
r_object.zincrby(f'{self.type}:date:{date}', nb, self.id)
update_obj_date(first_seen, self.type) update_obj_date(first_seen, self.type)
update_obj_date(last_seen, self.type) update_obj_date(last_seen, self.type)
self._add_create() self._add_create()