From 6b0f3b138d56ecf020f8d9353b5ef69c3eb29a3a Mon Sep 17 00:00:00 2001 From: Nate Coraor Date: Mon, 30 Aug 2010 13:35:44 -0400 Subject: [PATCH] Display the edit attributes confirmation message in a warning message instead of ok message if unable to update metadata because the dataset is being used as an input or output. --- lib/galaxy/web/controllers/root.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/web/controllers/root.py b/lib/galaxy/web/controllers/root.py index d0c466e742c..393e1e3209f 100644 --- a/lib/galaxy/web/controllers/root.py +++ b/lib/galaxy/web/controllers/root.py @@ -335,10 +335,11 @@ class RootController( BaseController, UsesHistory, UsesAnnotations ): if params.annotation: annotation = sanitize_html( params.annotation, 'utf-8', 'text/html' ) self.add_item_annotation( trans, data, annotation ) + trans.sa_session.flush() + return trans.show_ok_message( "Attributes updated%s" % message, refresh_frames=['history'] ) else: - message = ' (Metadata could not be changed because this dataset is currently being used as input or output. You must cancel or wait for these jobs to complete before changing metadata.)' - trans.sa_session.flush() - return trans.show_ok_message( "Attributes updated%s" % message, refresh_frames=['history'] ) + trans.sa_session.flush() + return trans.show_warn_message( "Attributes updated, but metadata could not be changed because this dataset is currently being used as input or output. You must cancel or wait for these jobs to complete before changing metadata.", refresh_frames=['history'] ) elif params.detect: # The user clicked the Auto-detect button on the 'Edit Attributes' form #prevent modifying metadata when dataset is queued or running as input/output