[hg] galaxy 2475: Fix for tool frame refresh when require_login ...
details: http://www.bx.psu.edu/hg/galaxy/rev/0b5d64cde142 changeset: 2475:0b5d64cde142 user: Greg Von Kuster <greg@bx.psu.edu> date: Fri Jul 10 16:15:32 2009 -0400 description: 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 ). 3 file(s) affected in this change: lib/galaxy/tools/parameters/basic.py lib/galaxy/web/controllers/user.py lib/galaxy/web/framework/__init__.py diffs (60 lines): diff -r 615a0bcf870b -r 0b5d64cde142 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py Fri Jul 10 15:24:01 2009 -0400 +++ b/lib/galaxy/tools/parameters/basic.py Fri Jul 10 16:15:32 2009 -0400 @@ -1115,6 +1115,10 @@ # 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 @@ 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 @@ 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 ) diff -r 615a0bcf870b -r 0b5d64cde142 lib/galaxy/web/controllers/user.py --- a/lib/galaxy/web/controllers/user.py Fri Jul 10 15:24:01 2009 -0400 +++ b/lib/galaxy/web/controllers/user.py Fri Jul 10 16:15:32 2009 -0400 @@ -168,8 +168,8 @@ 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 ) diff -r 615a0bcf870b -r 0b5d64cde142 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py Fri Jul 10 15:24:01 2009 -0400 +++ b/lib/galaxy/web/framework/__init__.py Fri Jul 10 16:15:32 2009 -0400 @@ -456,7 +456,9 @@ 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:
participants (1)
-
Greg Von Kuster