Ejemplo n.º 1
0
 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')
Ejemplo n.º 2
0
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')