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.

This commit is contained in:
Nate Coraor
2010-08-30 13:35:44 -04:00
parent ffff2160b2
commit 6b0f3b138d
+4 -3
View File
@@ -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