details: http://www.bx.psu.edu/hg/galaxy/rev/ef70e978e3fe changeset: 3772:ef70e978e3fe user: jeremy goecks <jeremy.goecks@emory.edu> date: Wed May 12 09:51:31 2010 -0400 description: Enable viewing of datasets via history/view when user is not logged in and/or when user does not have public username. diffstat: templates/root/history_common.mako | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diffs (22 lines): diff -r dea0ad16553e -r ef70e978e3fe templates/root/history_common.mako --- a/templates/root/history_common.mako Wed May 12 09:18:05 2010 -0400 +++ b/templates/root/history_common.mako Wed May 12 09:51:31 2010 -0400 @@ -38,8 +38,16 @@ if for_editing: display_url = h.url_for( controller='dataset', action='display', dataset_id=dataset_id, preview=True, filename='' ) else: - display_url = h.url_for( controller='dataset', action='display_by_username_and_slug', - username=data.history.user.username, slug=dataset_id ) + # Get URL for display only. + if data.history.user and data.history.user.username: + display_url = h.url_for( controller='dataset', action='display_by_username_and_slug', + username=data.history.user.username, slug=dataset_id ) + else: + # HACK: revert to for_editing display URL when there is no user/username. This should only happen when + # there's no user/username because dataset is being displayed by history/view after error reported. + # There are no security concerns here because both dataset/display and dataset/display_by_username_and_slug + # check user permissions (to the same degree) before displaying. + display_url = h.url_for( controller='dataset', action='display', dataset_id=dataset_id, preview=True, filename='' ) %> <a class="icon-button display tooltip" title="Display data in browser" href="${display_url}" %if for_editing: