From 1c727a4b6becd3aed6a69fa5866c6d01340d63c3 Mon Sep 17 00:00:00 2001 From: Carl Eberhard Date: Tue, 28 Jul 2015 15:24:02 -0400 Subject: [PATCH] Managers, taggable: make anon set_tags fail silently --- lib/galaxy/managers/taggable.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/taggable.py b/lib/galaxy/managers/taggable.py index 89e370d7342..6ae9fd741d4 100644 --- a/lib/galaxy/managers/taggable.py +++ b/lib/galaxy/managers/taggable.py @@ -2,7 +2,7 @@ Mixins for Taggable model managers and serializers. """ -from galaxy import exceptions as galaxy_exceptions +# from galaxy import exceptions as galaxy_exceptions import logging log = logging.getLogger( __name__ ) @@ -27,7 +27,10 @@ def _tags_to_strings( item ): def _tags_from_strings( item, tag_handler, new_tags_list, user=None ): # TODO: have to assume trans.user here... if not user: - raise galaxy_exceptions.RequestParameterMissingException( 'User required for tags on ' + str( item ) ) + # raise galaxy_exceptions.RequestParameterMissingException( 'User required for tags on ' + str( item ) ) + # TODO: this becomes a 'silent failure' - no tags are set. This is a questionable approach but + # I haven't found a better one for anon users copying items with tags + return # TODO: duped from tags manager - de-dupe when moved to taggable mixin tag_handler.delete_item_tags( user, item ) new_tags_str = ','.join( new_tags_list )