superseeds = self,
)
+ # Log action
log.debug("Cloned job %s as %s" % (self, job))
- # Update cache
- self.build._jobs.append(job)
-
return job
# Retry
raise RuntimeError("Job %s cannot be retried" % self)
# Clone the job
- return self.clone()
+ return await self.clone()
# Log
-{% extends "../base.html" %}
+{% extends "modal.html" %}
-{% block title %}{{ _("Retry Job %s") % job }}{% end block %}
+{% block title %}{{ _("Retry Job %s") % job }}{% endblock %}
-{% block container %}
+{% block breadcrumbs %}
<nav class="breadcrumb" aria-label="breadcrumbs">
<ul>
<li>
</li>
</ul>
</nav>
+{% endblock %}
- <div class="columns is-centered">
- <div class="column is-6">
- <form method="POST" action="">
- <div class="box">
- {% raw xsrf_form_html() %}
+{% block modal_title %}
+ <h4 class="title is-4">{{ _("Retry Job") }}</h4>
+ <h6 class="subtitle is-6">{{ job }}</h6>
+{% endblock %}
- <p class="title is-4">{{ _("Retry Job") }}</p>
- <p class="subtitle is-5">
- {{ _("Do you want to retry building %s?") % job }}
- </p>
+{% block modal %}
+ <form method="POST" action="">
+ {{ xsrf_form_html() | safe }}
- <button class="button is-fullwidth is-warning">
- {{ _("Retry") }}
- </button>
- </div>
- </form>
+ <div class="content">
+ <p>
+ {{ _("Do you want to retry building %s?") % job }}
+ </p>
</div>
- </div>
-{% end block %}
+
+ {# Submit! #}
+ <div class="field">
+ <button type="submit" class="button is-warning is-fullwidth">
+ {{ _("Retry Job") }}
+ </button>
+ </div>
+ </form>
+{% endblock %}
if not job.has_perm(self.current_user):
raise tornado.web.HTTPError(403)
- self.render("jobs/retry.html", job=job)
+ await self.render("jobs/retry.html", job=job)
@base.authenticated
async def post(self, uuid):
if not job:
raise tornado.web.HTTPError(404, "Could not find job %s" % uuid)
- async with await self.db.transaction():
- job = await job.retry(self.current_user)
+ # Retry the job
+ job = await job.retry(self.current_user)
- # Launch the newly created job
- await self.backend.jobs.launch([job])
+ # Launch the newly created job
+ await self.backend.jobs.launch([job])
# Redirect back to the build page
self.redirect("/builds/%s" % job.build.uuid)