details: http://www.bx.psu.edu/hg/galaxy/rev/acf985b23928 changeset: 3284:acf985b23928 user: jeremy goecks <jeremy.goecks@emory.edu> date: Wed Jan 27 15:49:50 2010 -0500 description: Ensure that workflows shared via email prior to changeset 3263:fe6e3c197d69 will have a slug for viewing. diffstat: lib/galaxy/web/base/controller.py | 5 ++++- lib/galaxy/web/controllers/workflow.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletions(-) diffs (40 lines): diff -r 69a04e6bd513 -r acf985b23928 lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py Wed Jan 27 08:51:23 2010 -0500 +++ b/lib/galaxy/web/base/controller.py Wed Jan 27 15:49:50 2010 -0500 @@ -146,7 +146,7 @@ self.set_item_slug( sa_session, item ) def set_item_slug( self, sa_session, item ): - """ Set item slug. Slug is unique among user's importable items for item's class. """ + """ Set item slug. Slug is unique among user's importable items for item's class. Returns true if item's slug was set; false otherwise. """ if item.slug is None or item.slug == "": # Replace whitespace with '-' slug_base = re.sub( "\s+", "-", item.name.lower() ) @@ -164,6 +164,9 @@ slug = '%s-%i' % ( slug_base, count ) count += 1 item.slug = slug + return True + + return False """ Deprecated: `BaseController` used to be available under the name `Root` diff -r 69a04e6bd513 -r acf985b23928 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py Wed Jan 27 08:51:23 2010 -0500 +++ b/lib/galaxy/web/controllers/workflow.py Wed Jan 27 15:49:50 2010 -0500 @@ -118,6 +118,14 @@ .filter( model.StoredWorkflow.deleted == False ) \ .order_by( desc( model.StoredWorkflow.update_time ) ) \ .all() + + # Legacy issue: all shared workflows must have slugs. + slug_set = False + for workflow_assoc in shared_by_others: + slug_set = self.set_item_slug( trans.sa_session, workflow_assoc.stored_workflow ) + if slug_set: + trans.sa_session.flush() + return trans.fill_template( "workflow/list.mako", workflows = workflows, shared_by_others = shared_by_others )