Fix for tool frame refresh when require_login config setting is true ( resolves ticket 100 ), eliminate center instead of end of history item name in DataToolParameter if name is > 30 chars ( resolves ticket # 64 ), and a log an error instead of raising an exception in get_history() if None is returned ( better behavior ).

This commit is contained in:
Greg Von Kuster
2009-07-10 16:15:32 -04:00
parent 56b30d94f9
commit e43a425d75
3 changed files with 11 additions and 5 deletions
+6 -2
View File
@@ -1115,6 +1115,10 @@ class DataToolParameter( ToolParameter ):
# CRUCIAL: the dataset_collector function needs to be local to DataToolParameter.get_html_field()
def dataset_collector( hdas, parent_hid ):
for i, hda in enumerate( hdas ):
if len( hda.name ) > 30:
hda_name = '%s..%s' % ( hda.name[:17], hda.name[-11:] )
else:
hda_name = hda.name
if parent_hid is not None:
hid = "%s.%d" % ( parent_hid, i + 1 )
else:
@@ -1132,7 +1136,7 @@ class DataToolParameter( ToolParameter ):
continue
if isinstance( hda.datatype, self.formats):
selected = ( value and ( hda in value ) )
field.add_option( "%s: %s" % ( hid, hda.name[:30] ), hda.id, selected )
field.add_option( "%s: %s" % ( hid, hda_name ), hda.id, selected )
else:
target_ext, converted_dataset = hda.find_conversion_destination( self.formats, converter_safe = self.converter_safe( other_values, trans ) )
if target_ext:
@@ -1141,7 +1145,7 @@ class DataToolParameter( ToolParameter ):
if not trans.app.security_agent.allow_action( trans.user, trans.app.security_agent.permitted_actions.DATASET_ACCESS, dataset=hda.dataset ):
continue
selected = ( value and ( hda in value ) )
field.add_option( "%s: (as %s) %s" % ( hid, target_ext, hda.name[:30] ), hda.id, selected )
field.add_option( "%s: (as %s) %s" % ( hid, target_ext, hda_name ), hda.id, selected )
# Also collect children via association object
dataset_collector( hda.children, hid )
dataset_collector( history.active_datasets, None )
+2 -2
View File
@@ -168,8 +168,8 @@ class User( BaseController ):
mail = os.popen("%s -t" % trans.app.config.sendmail_path, 'w')
mail.write("To: %s\nFrom: %s\nSubject: Join Mailing List\n\nJoin Mailing list." % (trans.app.config.mailing_join_addr,email) )
if mail.close():
return trans.show_warn_message( "Now logged in as " + user.email+". However, subscribing to the mailing list has failed.", refresh_frames=['masthead', 'history'] )
return trans.show_ok_message( "Now logged in as " + user.email, refresh_frames=['masthead', 'history'] )
return trans.show_warn_message( "Now logged in as " + user.email+". However, subscribing to the mailing list has failed.", refresh_frames=refresh_frames )
return trans.show_ok_message( "Now logged in as " + user.email, refresh_frames=refresh_frames )
return trans.show_form(
web.FormBuilder( web.url_for(), "Create account", submit_text="Create" )
.add_text( "email", "Email address", value=email, error=email_error )
+3 -1
View File
@@ -456,7 +456,9 @@ class UniverseWebTransaction( base.DefaultWebTransaction ):
if util.string_as_bool( create ):
history = self.new_history()
else:
raise "get_history() returning None"
# Perhaps a bot is running a tool without having logged in to get a history
log.debug( "Error: this request returned None from get_history(): %s" % self.request.browser_url )
return None
return history
def set_history( self, history ):
if history and not history.deleted: