Skip to content

Commit

Permalink
catalogues: also look in trash to find catalogues (maybe check remove…
Browse files Browse the repository at this point in the history
…d entirely)
  • Loading branch information
pboettch committed May 24, 2024
1 parent d3ac957 commit 0f14f47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tscat_gui/tscat_driver/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ class GetCatalogueAction(Action):
query_info: List[EventQueryInformation] = field(default_factory=list)

def action(self) -> None:
catalogue = get_catalogues(UUID(self.uuid))[0]
self.events, self.query_info = get_events(catalogue, removed_items=self.removed_items)
catalogues = get_catalogues(UUID(self.uuid))
if len(catalogues) == 0:
catalogues = get_catalogues(UUID(self.uuid), removed_items=True)
self.events, self.query_info = get_events(catalogues[0], removed_items=self.removed_items)


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion tscat_gui/tscat_driver/tscat_root_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime as dt
import itertools
import os
import pickle
import tempfile
Expand Down Expand Up @@ -144,7 +145,7 @@ def _driver_action_done(self, action: Action) -> None:

def catalog(self, uuid: str) -> CatalogModel:
if uuid not in self._catalogues:
for child in self._root.children:
for child in itertools.chain(self._root.children, self._trash.children):
if uuid == child.uuid:
break
else:
Expand Down

0 comments on commit 0f14f47

Please sign in to comment.