Skip to content

Commit

Permalink
templatetags: use the "global" BuildPublisher
Browse files Browse the repository at this point in the history
Don't call BuildPublisher.from_settings() and instead use the global
BuilBuildPublisher instance.
  • Loading branch information
enku committed Feb 17, 2024
1 parent 3d83e67 commit 362467e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/gentoo_build_publisher/templatetags/gbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
from django.urls import reverse
from django.utils.safestring import mark_safe

from gentoo_build_publisher import views
from gentoo_build_publisher import publisher, views
from gentoo_build_publisher.common import Build, Package
from gentoo_build_publisher.publisher import BuildPublisher
from gentoo_build_publisher.settings import Settings
from gentoo_build_publisher.utils import time

localtime = time.localtime
Expand Down Expand Up @@ -129,7 +127,6 @@ def roundrect(text: str, title: str, color: str) -> dict[str, Any]:
@register.inclusion_tag("gentoo_build_publisher/machine/build_row.html")
def machine_build_row(build: Build) -> dict[str, Any]:
"""Render a (Jenkins) build row"""
publisher = BuildPublisher.from_settings(Settings.from_environ())
packages_built = publisher.storage.get_metadata(build).packages.built
packages_built_str = "<br/>".join(p.cpv for p in packages_built)

Expand Down

0 comments on commit 362467e

Please sign in to comment.