commit/galaxy-central: carlfeberhard: Sharable managers: Generate slug on user share only if needed
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/62d257911db2/ Changeset: 62d257911db2 User: carlfeberhard Date: 2015-01-22 22:33:02+00:00 Summary: Sharable managers: Generate slug on user share only if needed Affected #: 2 files diff -r 67b17274944c9897620b63e62c3ce5c8ab6a5b9b -r 62d257911db2b0d3ee1a8c36b50270b66b3c4003 lib/galaxy/managers/sharable.py --- a/lib/galaxy/managers/sharable.py +++ b/lib/galaxy/managers/sharable.py @@ -203,8 +203,9 @@ self.associate( trans, user_share_assoc, item ) user_share_assoc.user = user - # waat? - self.create_unique_slug( trans, item ) + # ensure an item slug so shared users can access + if not item.slug: + self.create_unique_slug( trans, item ) if flush: self.app.model.context.flush() diff -r 67b17274944c9897620b63e62c3ce5c8ab6a5b9b -r 62d257911db2b0d3ee1a8c36b50270b66b3c4003 test/unit/managers/test_HistoryManager.py --- a/test/unit/managers/test_HistoryManager.py +++ b/test/unit/managers/test_HistoryManager.py @@ -223,6 +223,7 @@ self.log( "should be unshared by default" ) self.assertEqual( self.history_mgr.get_share_assocs( self.trans, item1 ), [] ) + self.assertEqual( item1.slug, None ) self.log( "should be able to share with specific users" ) share_assoc = self.history_mgr.share_with( self.trans, item1, non_owner ) @@ -232,6 +233,7 @@ len( self.history_mgr.get_share_assocs( self.trans, item1 ) ), 1 ) self.assertEqual( len( self.history_mgr.get_share_assocs( self.trans, item1, user=non_owner ) ), 1 ) + self.assertIsInstance( item1.slug, basestring ) self.log( "should be able to unshare with specific users" ) share_assoc = self.history_mgr.unshare_with( self.trans, item1, non_owner ) 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