Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@authenticated()
@template.output("pipeline_index.html")
def edit(self, pipeline_id):
pipelines = self.repository.get_all()
pipeline = self.repository.get(pipeline_id)
return template.render(authenticated=self.authenticated(), pipeline=pipeline, pipelines=pipelines, errors=None)
@authenticated()
@template.output("create_project.html")
def edit(self, project_id):
project = self.repository.get(project_id)
return template.render(authenticated=self.authenticated(), project=project)
@authenticated()
@template.output("pipeline_index.html")
def update(self, pipeline_id, name, pipeline_definition):
pipeline = self.repository.get(int(pipeline_id))
try:
pipeline = self.repository.update(pipeline.id, name, pipeline_definition)
PluginEvents.on_pipeline_updated(pipeline)
raise cherrypy.HTTPRedirect('/pipeline')
except (ProjectNotFoundError, CyclicalPipelineError), err:
pipelines = self.repository.get_all()
return template.render(authenticated=self.authenticated(), pipelines=pipelines, pipeline=pipeline, errors=[err.message,]) | HTMLFormFiller(data=locals())
@template.output("login.html")
def login_error(self, cancel=False, **data):
data["login_error"] = "In order to do that you need to login. Please perform login below."
return self.do_login(cancel, data)
@template.output("project_details.html")
def build_details(self, project_id, build_id):
return self.render_details(project_id, build_id)
@template.output("project_details.html")
def details(self, project_id):
return self.render_details(project_id)
@template.output("login.html")
def login(self, cancel=False, **data):
return self.do_login(cancel, data)
@template.output("dashboard.html")
def dashboard(self):
repository = ProjectRepository()
projects = repository.get_all()
return template.render(authenticated=self.authenticated(), projects=projects)
@template.output("pipeline_index.html")
def index(self):
pipelines = self.repository.get_all()
return template.render(authenticated=self.authenticated(), pipeline=None, pipelines=pipelines, errors=None)
@authenticated()
@template.output("create_project.html")
def new(self):
return template.render(authenticated=self.authenticated(), project=None)