def default(self, id): try: kickstart = RenderedKickstart.by_id(id) except NoResultFound: raise cherrypy.NotFound(id) if kickstart.url: redirect(kickstart.url) return kickstart.kickstart.encode('utf8')
def get_kickstart(id): """ Flask endpoint for serving up generated kickstarts. """ try: kickstart = RenderedKickstart.by_id(id) except NoResultFound: abort(404) return redirect(kickstart.url) if kickstart.url else Response( kickstart.kickstart.encode('utf8'), mimetype='text/plain')