M buildsrht/blueprints/jobs.py => buildsrht/blueprints/jobs.py +14 -0
@@ 510,3 510,17 @@ def job_by_id(username, job_id):
sort_tasks=lambda tasks: sorted(tasks, key=lambda t: t.id),
min_artifact_date=min_artifact_date,
payment_required=payment_required)
+
+@jobs.route("/~<username>/job/<int:job_id>/manifest")
+def manifest_by_job_id(username, job_id):
+ user = User.query.filter(User.username == username).first()
+ if not user:
+ abort(404)
+ job = Job.query.options(sa.orm.joinedload(Job.tasks)).get(job_id)
+ if not job:
+ abort(404)
+ if not get_access(job):
+ abort(404)
+ if job.owner_id != user.id:
+ abort(404)
+ return Response(job.manifest, mimetype="text/plain")
M buildsrht/templates/job.html => buildsrht/templates/job.html +1 -1
@@ 69,7 69,7 @@
<dt>Updated</dt>
<dd>{{ job.updated | date }}</dd>
<dt>Build manifest</dt>
- <dd><a href="/api/jobs/{{ job.id }}/manifest">view manifest »</a></dd>
+ <dd><a href="/~{{ job.owner.username }}/job/{{ job.id }}/manifest">view manifest »</a></dd>
</dl>
{% if current_user and job.status.value in [
"success", "failed", "timeout", "cancelled"