commit/galaxy-central: jgoecks: Fix bugs in cloning a visualization.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/f8a94b3bbc3a/ changeset: f8a94b3bbc3a user: jgoecks date: 2011-09-27 20:16:52 summary: Fix bugs in cloning a visualization. affected #: 1 file (-1 bytes) --- a/lib/galaxy/web/controllers/visualization.py Tue Sep 27 13:06:34 2011 -0400 +++ b/lib/galaxy/web/controllers/visualization.py Tue Sep 27 14:16:52 2011 -0400 @@ -92,13 +92,14 @@ @web.expose @web.require_login() def clone(self, trans, id, *args, **kwargs): - visualization = self.get_visualization( trans, id, check_ownership=False ) + visualization = self.get_visualization( trans, id, check_ownership=False ) user = trans.get_user() - if trans.sa_session.query( model.VisualizationUserShareAssociation ) \ - .filter_by( user=user, visualization=visualization ).count() == 0: - error( "Visualization is not owned by or shared with current user" ) + owner = ( visualization.user == user ) + new_title = "Copy of '%s'" % visualization.title + if not owner: + new_title += " shared by %s" % visualization.user.email - cloned_visualization = visualization.copy( user=trans.user, title="Copy of '%s'" % visualization.title ) + cloned_visualization = visualization.copy( user=trans.user, title=new_title ) # Persist session = trans.sa_session Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket