commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/00d8ec60fdc0/ Changeset: 00d8ec60fdc0 Branch: stable User: carlfeberhard Date: 2013-11-12 17:10:04 Summary: History grid: fix logic to prevent deleting/purging a shared history Affected #: 1 file diff -r 56b077b51694fba1dcb37044dc8f2c0ea8d8b9bf -r 00d8ec60fdc02d3918b6896cf4a8d0cee27f350c lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -17,10 +17,12 @@ log = logging.getLogger( __name__ ) + class NameColumn( grids.TextColumn ): def get_value( self, trans, grid, history ): return history.get_display_name() + class HistoryListGrid( grids.Grid ): # Custom column types @@ -303,32 +305,33 @@ if history.users_shared_with: message_parts.append( "History (%s) has been shared with others, unshare it before deleting it. " % history.name ) status = ERROR - elif not history.deleted: - # We'll not eliminate any DefaultHistoryPermissions in case we undelete the history later - history.deleted = True - # If deleting the current history, make a new current. - if history == trans.get_history(): - deleted_current = True - trans.log_event( "History (%s) marked as deleted" % history.name ) - n_deleted += 1 - if purge and trans.app.config.allow_user_dataset_purge: - for hda in history.datasets: - if trans.user: - trans.user.total_disk_usage -= hda.quota_amount( trans.user ) - hda.purged = True - trans.sa_session.add( hda ) - trans.log_event( "HDA id %s has been purged" % hda.id ) - trans.sa_session.flush() - if hda.dataset.user_can_purge: - try: - hda.dataset.full_delete() - trans.log_event( "Dataset id %s has been purged upon the the purge of HDA id %s" % ( hda.dataset.id, hda.id ) ) - trans.sa_session.add( hda.dataset ) - except: - log.exception( 'Unable to purge dataset (%s) on purge of hda (%s):' % ( hda.dataset.id, hda.id ) ) - history.purged = True - self.sa_session.add( history ) - self.sa_session.flush() + else: + if not history.deleted: + # We'll not eliminate any DefaultHistoryPermissions in case we undelete the history later + history.deleted = True + # If deleting the current history, make a new current. + if history == trans.get_history(): + deleted_current = True + trans.log_event( "History (%s) marked as deleted" % history.name ) + n_deleted += 1 + if purge and trans.app.config.allow_user_dataset_purge: + for hda in history.datasets: + if trans.user: + trans.user.total_disk_usage -= hda.quota_amount( trans.user ) + hda.purged = True + trans.sa_session.add( hda ) + trans.log_event( "HDA id %s has been purged" % hda.id ) + trans.sa_session.flush() + if hda.dataset.user_can_purge: + try: + hda.dataset.full_delete() + trans.log_event( "Dataset id %s has been purged upon the the purge of HDA id %s" % ( hda.dataset.id, hda.id ) ) + trans.sa_session.add( hda.dataset ) + except: + log.exception( 'Unable to purge dataset (%s) on purge of hda (%s):' % ( hda.dataset.id, hda.id ) ) + history.purged = True + self.sa_session.add( history ) + self.sa_session.flush() trans.sa_session.flush() if n_deleted: part = "Deleted %d %s" % ( n_deleted, iff( n_deleted != 1, "histories", "history" ) ) https://bitbucket.org/galaxy/galaxy-central/commits/5e4174bee7de/ Changeset: 5e4174bee7de User: carlfeberhard Date: 2013-11-12 17:11:01 Summary: Merge stable Affected #: 1 file diff -r 1479c52c26e2bbc1fa4b367d1e718be966f5eb63 -r 5e4174bee7de7e29eb6021b2097568a4c8f597b9 lib/galaxy/webapps/galaxy/controllers/history.py --- a/lib/galaxy/webapps/galaxy/controllers/history.py +++ b/lib/galaxy/webapps/galaxy/controllers/history.py @@ -17,10 +17,12 @@ log = logging.getLogger( __name__ ) + class NameColumn( grids.TextColumn ): def get_value( self, trans, grid, history ): return history.get_display_name() + class HistoryListGrid( grids.Grid ): # Custom column types @@ -303,32 +305,33 @@ if history.users_shared_with: message_parts.append( "History (%s) has been shared with others, unshare it before deleting it. " % history.name ) status = ERROR - elif not history.deleted: - # We'll not eliminate any DefaultHistoryPermissions in case we undelete the history later - history.deleted = True - # If deleting the current history, make a new current. - if history == trans.get_history(): - deleted_current = True - trans.log_event( "History (%s) marked as deleted" % history.name ) - n_deleted += 1 - if purge and trans.app.config.allow_user_dataset_purge: - for hda in history.datasets: - if trans.user: - trans.user.total_disk_usage -= hda.quota_amount( trans.user ) - hda.purged = True - trans.sa_session.add( hda ) - trans.log_event( "HDA id %s has been purged" % hda.id ) - trans.sa_session.flush() - if hda.dataset.user_can_purge: - try: - hda.dataset.full_delete() - trans.log_event( "Dataset id %s has been purged upon the the purge of HDA id %s" % ( hda.dataset.id, hda.id ) ) - trans.sa_session.add( hda.dataset ) - except: - log.exception( 'Unable to purge dataset (%s) on purge of hda (%s):' % ( hda.dataset.id, hda.id ) ) - history.purged = True - self.sa_session.add( history ) - self.sa_session.flush() + else: + if not history.deleted: + # We'll not eliminate any DefaultHistoryPermissions in case we undelete the history later + history.deleted = True + # If deleting the current history, make a new current. + if history == trans.get_history(): + deleted_current = True + trans.log_event( "History (%s) marked as deleted" % history.name ) + n_deleted += 1 + if purge and trans.app.config.allow_user_dataset_purge: + for hda in history.datasets: + if trans.user: + trans.user.total_disk_usage -= hda.quota_amount( trans.user ) + hda.purged = True + trans.sa_session.add( hda ) + trans.log_event( "HDA id %s has been purged" % hda.id ) + trans.sa_session.flush() + if hda.dataset.user_can_purge: + try: + hda.dataset.full_delete() + trans.log_event( "Dataset id %s has been purged upon the the purge of HDA id %s" % ( hda.dataset.id, hda.id ) ) + trans.sa_session.add( hda.dataset ) + except: + log.exception( 'Unable to purge dataset (%s) on purge of hda (%s):' % ( hda.dataset.id, hda.id ) ) + history.purged = True + self.sa_session.add( history ) + self.sa_session.flush() trans.sa_session.flush() if n_deleted: part = "Deleted %d %s" % ( n_deleted, iff( n_deleted != 1, "histories", "history" ) ) 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)
-
commits-noreply@bitbucket.org