From: Michael Tremer Date: Wed, 12 Feb 2025 18:03:07 +0000 (+0000) Subject: builds: Fix sending bugfs reports to Bugzilla X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f468cf64c3500f7945199a224838ba0076c89735;p=pbs.git builds: Fix sending bugfs reports to Bugzilla Signed-off-by: Michael Tremer --- diff --git a/src/templates/builds/bug-created.html b/src/templates/builds/bug-created.html index 1377e1dc..c7667df6 100644 --- a/src/templates/builds/bug-created.html +++ b/src/templates/builds/bug-created.html @@ -1,6 +1,6 @@ -{% extends "../modal.html" %} +{% extends "modal.html" %} -{% block title %}{{ build }} - {{ _("Bug Created") }}{% end block %} +{% block title %}{{ build }} - {{ _("Bug Created") }}{% endblock %} {% block breadcrumbs %} -{% end block %} +{% endblock %} {% block modal_title %} -

{{ _("Bug %s Created") % bug }}

-{% end block %} +

+ {{ _("Bug %s Created") % bug }} +

+{% endblock %} {% block modal %}
@@ -43,4 +48,4 @@ {{ _("Go Back To Build") }}
-{% end block %} +{% endblock %} diff --git a/src/templates/builds/bug.html b/src/templates/builds/bug.html index 0096c103..b4419ea8 100644 --- a/src/templates/builds/bug.html +++ b/src/templates/builds/bug.html @@ -1,6 +1,6 @@ -{% extends "../modal.html" %} +{% extends "modal.html" %} -{% block title %}{{ build }} - {{ _("File Bug Report") }}{% end block %} +{% block title %}{{ build }} - {{ _("File Bug Report") }}{% endblock %} {% block breadcrumbs %} -{% end block %} +{% endblock %} {% block modal_title %}

{{ _("File A Bug Report For %s") % build }}

-{% end block %} +{% endblock %} {% block modal %}
- {% raw xsrf_form_html() %} + {{ xsrf_form_html() | safe }} {# Summary #}
+
@@ -41,6 +42,7 @@ {# Description #}
+
@@ -53,12 +55,12 @@
- {% end %} + {% endfor %} {# Submit! #}
@@ -67,4 +69,4 @@
-{% end block %} +{% endblock %} diff --git a/src/web/builds.py b/src/web/builds.py index 18437c05..dd330869 100644 --- a/src/web/builds.py +++ b/src/web/builds.py @@ -240,18 +240,18 @@ class CommentHandler(base.BaseHandler): class BugHandler(base.BaseHandler): @base.authenticated async def get(self, uuid): - build = self.backend.builds.get_by_uuid(uuid) + build = await self.backend.builds.get_by_uuid(uuid) if not build: raise tornado.web.HTTPError(404, "Could not find build %s" % uuid) # Fetch fields fields = await self.backend.bugzilla.fields - self.render("builds/bug.html", build=build, fields=fields) + await self.render("builds/bug.html", build=build, fields=fields) @base.authenticated async def post(self, uuid): - build = self.backend.builds.get_by_uuid(uuid) + build = await self.backend.builds.get_by_uuid(uuid) if not build: raise tornado.web.HTTPError(404, "Could not find build %s" % uuid) @@ -282,10 +282,14 @@ class BugHandler(base.BaseHandler): continue # Attach it to the bug - await bug.attach(summary="Log file for %s" % job, filename="%s.log" % job, - data=log, content_type="text/plain") + await bug.attach( + summary = "Log file for %s" % job, + filename = "%s.log" % job, + data = log, + content_type = "text/plain", + ) - self.render("builds/bug-created.html", build=build, bug=bug) + await self.render("builds/bug-created.html", build=build, bug=bug) class ReposAddHandler(base.BaseHandler):