mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Merge stable.
This commit is contained in:
@@ -18,4 +18,4 @@ a4113cc1cb5eaa68091c9a73375f00555b66dd11 release_2013.01.13
|
||||
81fbe25bd02edcd53065e8e4476dd1dfb5a72cf2 latest_2013.11.04
|
||||
2a756ca2cb1826db7796018e77d12e2dd7b67603 latest_2014.02.10
|
||||
ca45b78adb4152fc6e7395514d46eba6b7d0b838 release_2014.08.11
|
||||
7e22f35798522100ff03e1fdd4eced962b292360 latest_2014.08.11
|
||||
109b170188e97fbfc2c998ec174aff9546dd1bd8 latest_2014.08.11
|
||||
|
||||
@@ -35,9 +35,9 @@ class Tree( object ):
|
||||
return self._walk_collections( dict_map( lambda hdca: hdca.collection, hdca_dict ) )
|
||||
|
||||
def _walk_collections( self, collection_dict ):
|
||||
for ( identifier, substructure ) in self.children:
|
||||
for index, ( identifier, substructure ) in enumerate( self.children ):
|
||||
def element( collection ):
|
||||
return collection[ identifier ]
|
||||
return collection[ index ]
|
||||
|
||||
if substructure.is_leaf:
|
||||
yield dict_map( element, collection_dict )
|
||||
|
||||
@@ -27,7 +27,7 @@ from galaxy.web import error, url_for
|
||||
from galaxy.web.form_builder import AddressField, CheckboxField, SelectField, TextArea, TextField
|
||||
from galaxy.web.form_builder import build_select_field, HistoryField, PasswordField, WorkflowField, WorkflowMappingField
|
||||
from galaxy.workflow.modules import module_factory, WorkflowModuleInjector, MissingToolException
|
||||
from galaxy.model.orm import eagerload, eagerload_all, desc
|
||||
from galaxy.model.orm import eagerload, eagerload_all, desc, not_
|
||||
from galaxy.security.validate_user_input import validate_publicname
|
||||
from galaxy.util.sanitize_html import sanitize_html
|
||||
from galaxy.model.item_attrs import Dictifiable, UsesAnnotations
|
||||
@@ -2683,7 +2683,7 @@ class SharableMixin:
|
||||
item = self.get_item( trans, id )
|
||||
if item:
|
||||
# Only update slug if slug is not already in use.
|
||||
if trans.sa_session.query( item.__class__ ).filter_by( user=item.user, slug=new_slug, importable=True ).count() == 0:
|
||||
if trans.sa_session.query( item.__class__ ).filter_by( user=item.user, slug=new_slug ).count() == 0:
|
||||
item.slug = new_slug
|
||||
trans.sa_session.flush()
|
||||
|
||||
@@ -2718,7 +2718,9 @@ class SharableMixin:
|
||||
# add integer to end.
|
||||
new_slug = slug_base
|
||||
count = 1
|
||||
while sa_session.query( item.__class__ ).filter_by( user=item.user, slug=new_slug, importable=True ).count() != 0:
|
||||
# Ensure unique across model class and user and don't include this item
|
||||
# in the check in case it has previously been assigned a valid slug.
|
||||
while sa_session.query( item.__class__ ).filter( item.__class__.user == item.user, item.__class__.slug == new_slug, item.__class__.id != item.id).count() != 0:
|
||||
# Slug taken; choose a new slug based on count. This approach can
|
||||
# handle numerous items with the same name gracefully.
|
||||
new_slug = '%s-%i' % ( slug_base, count )
|
||||
|
||||
Reference in New Issue
Block a user