Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created February 26, 2014 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmchilton/9230481 to your computer and use it in GitHub Desktop.
Save jmchilton/9230481 to your computer and use it in GitHub Desktop.
More logging for importing libraries to history.
diff -r fac578cca758 lib/galaxy/webapps/galaxy/controllers/library_common.py
--- a/lib/galaxy/webapps/galaxy/controllers/library_common.py Fri Feb 21 22:09:57 2014 -0600
+++ b/lib/galaxy/webapps/galaxy/controllers/library_common.py Wed Feb 26 08:34:28 2014 -0600
@@ -2001,6 +2001,7 @@
status = 'error'
else:
if new_history_name:
+ log.info("Handling new history.")
new_history = trans.app.model.History()
new_history.name = new_history_name
new_history.user = user
@@ -2010,7 +2011,16 @@
target_histories = [ new_history ]
elif user:
target_histories = [ hist for hist in map( trans.sa_session.query( trans.app.model.History ).get, target_history_ids ) if ( hist is not None and hist.user == user )]
+
+ def user_str( user ):
+ props = trans.app.model.User.user_template_environment( user )
+ return "User<%s>" % ( str( props ) )
+
+ log.info( "Have user %s" % user_str( user ) )
+ log.info( "raw_target_histories are %s" % str([ hist for hist in map( trans.sa_session.query( trans.app.model.History ).get, target_history_ids ) ] ) )
+ log.info( "raw_target_histories owners are %s" % str([ user_str(hist.user) for hist in map( trans.sa_session.query( trans.app.model.History ).get, target_history_ids ) ] ) )
else:
+ log.info( "Have no user." )
target_histories = [ current_history ]
if len( target_histories ) != len( target_history_ids ):
message += "You do not have permission to add datasets to %i requested histories. " % ( len( target_history_ids ) - len( target_histories ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment