Skip to content

Commit

Permalink
Capture more HDA state transitions in the history panel.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Mar 21, 2018
1 parent a73a1d6 commit 8fe5b5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/galaxy/jobs/__init__.py
Expand Up @@ -1072,7 +1072,15 @@ def change_state(self, state, info=False, flush=True, job=None):
dataset = dataset_assoc.dataset
if not job_supplied:
self.sa_session.refresh(dataset)
dataset.raw_set_dataset_state(state)
state_changed = dataset.raw_set_dataset_state(state)
if state_changed:
# Arguably a hack to get state changes to appear in the history panel because
# the history panel polls on hda.update_time and ignores hda.dataset.update_time.
# For those less pragmatic needing a more theoretically sound reason for the update,
# perhaps arguments can be made that the entity that is the HDA
# really should be described as updated since its effective state did change and its
# RESTful representation in the API does change as a result of the above dataset update.
dataset.update()
if info:
dataset.info = info
self.sa_session.add(dataset)
Expand Down
3 changes: 3 additions & 0 deletions lib/galaxy/model/__init__.py
Expand Up @@ -2004,6 +2004,9 @@ def __init__(self, id=None, hid=None, name=None, info=None, blurb=None, peek=Non
self.parent_id = parent_id
self.validation_errors = validation_errors

def update(self):
self.update_time = galaxy.model.orm.now.now()

@property
def ext(self):
return self.extension
Expand Down

0 comments on commit 8fe5b5c

Please sign in to comment.