From: Michael Tremer Date: Wed, 22 Jun 2022 14:41:25 +0000 (+0000) Subject: builds: Drop bugs page X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=005d9c70991b07005fec074b7cda0219ad725b94;p=pbs.git builds: Drop bugs page Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 53386673..362b752b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -147,7 +147,6 @@ webdir = $(buildservicedir)/web dist_templates_DATA = \ src/templates/base.html \ - src/templates/build-bugs.html \ src/templates/build-delete.html \ src/templates/build-filter.html \ src/templates/build-list.html \ diff --git a/src/templates/build-bugs.html b/src/templates/build-bugs.html deleted file mode 100644 index 2913de64..00000000 --- a/src/templates/build-bugs.html +++ /dev/null @@ -1,169 +0,0 @@ -{% extends "base.html" %} - -{% block title %}{{ _("Bug list") }}: {{ build.name }}{% end block %} - -{% block body %} - - - {% module BuildHeadline(build, short=True) %} - -
-
- {% if fixed_bugs %} -

{{ _("Fixed bugs") }}

- {% module BugsTable(pkg, fixed_bugs) %} - {% else %} -

- {{ _("No bugs here, yet.") }} - {{ _("Click below to add one.") } -

- {% end %} -
-
- -
-
-
-
- - {{ _("Add") }} - - - {% if fixed_bugs %} - - {{ _("Remove") }} - - {% end %} -
- - -
-
-
- - - - -{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 96f3e06e..45179908 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -126,7 +126,6 @@ class Application(tornado.web.Application): # Builds (r"/builds", builds.IndexHandler), (r"/builds/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", builds.ShowHandler), - (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/bugs", builds.BuildBugsHandler), (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/manage", builds.BuildManageHandler), (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/comment", builds.BuildDetailCommentHandler), (r"/build/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/state", builds.BuildStateHandler), diff --git a/src/web/builds.py b/src/web/builds.py index e6c57679..bec81a7f 100644 --- a/src/web/builds.py +++ b/src/web/builds.py @@ -63,63 +63,6 @@ class BuildDeleteHandler(BuildBaseHandler): self.render("build-delete.html", build=build) -class BuildBugsHandler(base.BaseHandler): - @tornado.web.authenticated - def get(self, uuid): - build = self.backend.builds.get_by_uuid(uuid) - if not build: - raise tornado.web.HTTPError(404, "No such build: %s" % uuid) - - # Check if the user has got the right to alter this build. - if not build.has_perm(self.current_user): - raise tornado.web.HTTPError(403) - - # Bugs. - fixed_bugs = build.get_bugs() - open_bugs = [] - - for bug in self.backend.bugzilla.get_bugs_from_component(build.pkg.name): - if bug in fixed_bugs: - continue - - open_bugs.append(bug) - - self.render("build-bugs.html", build=build, pkg=build.pkg, - fixed_bugs=fixed_bugs, open_bugs=open_bugs) - - @tornado.web.authenticated - def post(self, uuid): - build = self.backend.builds.get_by_uuid(uuid) - if not build: - raise tornado.web.HTTPError(404, "No such build: %s" % uuid) - - # Check if the user has got the right to alter this build. - if not build.has_perm(self.current_user): - raise tornado.web.HTTPError(403) - - action = self.get_argument("action", None) - bugid = self.get_argument("bugid") - - # Convert the bug id to integer. - try: - bugid = int(bugid) - except ValueError: - raise tornado.web.HTTPError(400, "Bad bug id given: %s" % bugid) - - if action == "add": - # Add bug to the build. - build.add_bug(bugid, user=self.current_user) - - elif action == "remove": - # Remove bug from the build. - build.rem_bug(bugid, user=self.current_user) - - else: - raise tornado.web.HTTPError(400, "Unhandled action: %s" % action) - - self.redirect("/build/%s/bugs" % build.uuid) - - class BuildStateHandler(base.BaseHandler): def get(self, uuid): build = self.backend.builds.get_by_uuid(uuid)