[hg] galaxy 3590: Importing a workflow makes a copy rather than ...
details: http://www.bx.psu.edu/hg/galaxy/rev/fa70c688cda1 changeset: 3590:fa70c688cda1 user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Apr 01 10:56:59 2010 -0400 description: Importing a workflow makes a copy rather than sharing it. diffstat: lib/galaxy/web/controllers/workflow.py | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diffs (25 lines): diff -r ac96e6e33164 -r fa70c688cda1 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py Wed Mar 31 17:46:25 2010 -0400 +++ b/lib/galaxy/web/controllers/workflow.py Thu Apr 01 10:56:59 2010 -0400 @@ -299,13 +299,16 @@ # TODO: this is only reasonable as long as import creates a sharing relation. return trans.show_error_message( "You can't import this workflow because it is already shared with you.<br>You can %s" % referer_message, use_panels=True ) else: - # TODO: Shouldn't an import provide a copy of a workflow? - share = model.StoredWorkflowUserShareAssociation() - share.stored_workflow = stored - share.user = trans.user + # Create imported workflow via copy. + imported_stored = model.StoredWorkflow() + imported_stored.name = "imported: " + stored.name + imported_stored.latest_workflow = stored.latest_workflow + imported_stored.user = trans.user + # Save new workflow. session = trans.sa_session - session.add( share ) + session.add( imported_stored ) session.flush() + # Redirect to load galaxy frames. return trans.show_ok_message( message="""Workflow "%s" has been imported. <br>You can <a href="%s">start using this workflow</a> or %s."""
participants (1)
-
Greg Von Kuster