commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/50a09eeaef45/ Changeset: 50a09eeaef45 User: carlfeberhard Date: 2015-01-22 19:47:38+00:00 Summary: Fix to annotatable: setting/deserializing the annotation to None deletes the annotation for the current user Affected #: 2 files diff -r 5f5ef6ec6f9c83fd7132b40ef3dc9a01fb07a34d -r 50a09eeaef455e979ad4901b5ab208bd9ef95f41 lib/galaxy/managers/annotatable.py --- a/lib/galaxy/managers/annotatable.py +++ b/lib/galaxy/managers/annotatable.py @@ -26,11 +26,13 @@ """ Get and serialize an `item`'s annotation. """ -#TODO: which is correct here? + #TODO: have to assume trans.user here... #user = item.user user = trans.user sa_session = self.app.model.context - return item.get_item_annotation_str( sa_session, user, item ) + returned = item.get_item_annotation_str( sa_session, user, item ) + print 'annotation:', returned, type( returned ) + return returned # ============================================================================= @@ -41,10 +43,17 @@ def deserialize_annotation( self, trans, item, key, val ): """ - Make sure `val` is a valid annotation and assign it. + Make sure `val` is a valid annotation and assign it, deleting any existing + if `val` is None. """ -#TODO: no validate here... val = self.validate.nullable_basestring( key, val ) + + sa_session = self.app.model.context #TODO: have to assume trans.user here... - return item.add_item_annotation( trans.sa_session, trans.user, item, val ) + user = trans.user + if val is None: + item.delete_item_annotation( sa_session, user, item ) + return None + model = item.add_item_annotation( sa_session, user, item, val ) + return model.annotation diff -r 5f5ef6ec6f9c83fd7132b40ef3dc9a01fb07a34d -r 50a09eeaef455e979ad4901b5ab208bd9ef95f41 lib/galaxy/managers/hdas.py --- a/lib/galaxy/managers/hdas.py +++ b/lib/galaxy/managers/hdas.py @@ -590,12 +590,7 @@ 'genome_build' : lambda t, i, k, v: self.deserialize_genome_build( t, i, 'dbkey', v ), 'misc_info' : lambda t, i, k, v: self.deserialize_basestring( t, i, 'info', v ), - # mixin: annotatable - 'annotation' : self.deserialize_annotation, - # mixin: taggable - 'tags' : self.deserialize_tags, - - # mixin: deletable + #TODO: mixin: deletable 'deleted' : self.deserialize_bool, # sharable 'published' : self.deserialize_bool, https://bitbucket.org/galaxy/galaxy-central/commits/cf423ef6e616/ Changeset: cf423ef6e616 User: carlfeberhard Date: 2015-01-22 19:51:09+00:00 Summary: Merge Affected #: 1 file diff -r 50a09eeaef455e979ad4901b5ab208bd9ef95f41 -r cf423ef6e6160e0437336c08c526ced45f8a9987 lib/galaxy/managers/hdas.py --- a/lib/galaxy/managers/hdas.py +++ b/lib/galaxy/managers/hdas.py @@ -145,14 +145,14 @@ #def by_user( self, trans, user ): # pass - def purge( self, trans, hda ): + def purge( self, trans, hda, flush=True ): """ Purge this HDA and the dataset underlying it. """ # error here if disallowed - before jobs are stopped #TODO: poss. move to DatasetAssociationManager self.dataset_manager.error_unless_dataset_purge_allowed( trans, hda ) - super( HDAManager, self ).purge( trans, hda, flush=True ) + super( HDAManager, self ).purge( trans, hda, flush=flush ) # signal to stop the creating job? if hda.creating_job_associations: @@ -354,7 +354,7 @@ 'display_apps', 'display_types', 'visualizations', - + #'url', 'download_url', 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