Skip to content

Commit

Permalink
Better deletion II
Browse files Browse the repository at this point in the history
  • Loading branch information
originalsouth committed Dec 11, 2024
1 parent e703325 commit 9d426d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions octopoes/octopoes/core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ def get_ooi_tree(
return tree

def _delete_ooi(self, reference: Reference, valid_time: datetime) -> None:
referencing_origins = self.origin_repository.list_origins(valid_time, result=reference)
if not any(
origin
for origin in referencing_origins
if not (
origin.origin_type == OriginType.AFFIRMATION
or (origin.origin_type == OriginType.INFERENCE and origin.source == reference)
for origin in self.origin_repository.list_origins(
valid_time,
origin_type={OriginType.DECLARATION, OriginType.OBSERVATION, OriginType.INFERENCE, OriginType.NIBBLET},
result=reference,
)
if not (origin.origin_type in [OriginType.INFERENCE, OriginType.NIBBLET] and origin.source == reference)
):
self.ooi_repository.delete_if_exists(reference, valid_time)

Expand Down

0 comments on commit 9d426d6

Please sign in to comment.