Skip to content

Commit

Permalink
views: code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
enku committed Sep 14, 2024
1 parent 4ca6c1a commit 64f7ae8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gentoo_build_publisher/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
@render("gentoo_build_publisher/dashboard/main.html")
def dashboard(request: HttpRequest) -> ViewContext:
"""Dashboard view"""
input_context = ViewInputContext(
cache=cache,
color_range=color_range_from_settings(),
days=get_query_value_from_request(request, "chart_days", int, 7),
)
color_range = color_range_from_settings()
days = get_query_value_from_request(request, "chart_days", int, 7)
input_context = ViewInputContext(cache=cache, color_range=color_range, days=days)

return create_dashboard_context(input_context)


Expand All @@ -47,8 +46,9 @@ def machines(request: HttpRequest, machine: str) -> ViewContext:
raise Http404("No builds for this machine")

days = get_query_value_from_request(request, "chart_days", int, 7)
color_range = color_range_from_settings()
input_context = MachineInputContext(
cache=cache, color_range=color_range_from_settings(), days=days, machine=machine
cache=cache, color_range=color_range, days=days, machine=machine
)
return create_machine_context(input_context)

Expand Down

0 comments on commit 64f7ae8

Please sign in to comment.