def biostar_redirect(self, trans, payload=None, biostar_action=None): """ Generate a redirect to a Biostar site using external authentication to pass Galaxy user information and optional information about a specific tool. """ try: url, payload = biostar.get_biostar_url(trans.app, payload=payload, biostar_action=biostar_action) except Exception as e: return error(str(e)) # Only create/log in biostar user if is registered Galaxy user if trans.user: biostar.create_cookie(trans, trans.app.config.biostar_key_name, trans.app.config.biostar_key, trans.user.email) if payload: return trans.fill_template("biostar/post_redirect.mako", post_url=url, form_inputs=payload) return trans.response.send_redirect(url)
class BiostarController(BaseUIController): """ Provides integration with Biostar through external authentication, see: http://liondb.com/help/x/ """ @web.expose def biostar_redirect(self, trans, payload=None, biostar_action=None): """ Generate a redirect to a Biostar site using external authentication to pass Galaxy user information and optional information about a specific tool. """ try: url, payload = biostar.get_biostar_url( trans.app, payload=payload, biostar_action=biostar_action) except Exception, e: return error(str(e)) # Only create/log in biostar user if is registered Galaxy user if trans.user: biostar.create_cookie(trans, trans.app.config.biostar_key_name, trans.app.config.biostar_key, trans.user.email) if payload: return trans.fill_template("biostar/post_redirect.mako", post_url=url, form_inputs=payload) return trans.response.send_redirect(url)