Skip to content

Commit

Permalink
views.utils: fix incorrect type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
enku committed Jan 18, 2024
1 parent b22bb4b commit f142b47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/gentoo_build_publisher/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ def wrapper(request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
def dashboard(request: HttpRequest) -> HttpResponse:
"""Dashboard view"""
input_context = ViewInputContext(
days=get_query_value_from_request(request, "chart_days", int, 7),
cache=cache,
color_range=color_range_from_settings(),
days=get_query_value_from_request(request, "chart_days", int, 7),
publisher=BuildPublisher.get_publisher(),
cache=cache,
)
context = create_dashboard_context(input_context)

Expand All @@ -92,11 +92,11 @@ def machines(request: HttpRequest, machine: str) -> HttpResponse:
raise Http404("No builds for this machine")

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

Expand Down
2 changes: 1 addition & 1 deletion src/gentoo_build_publisher/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def get_chart_days(start: dt.datetime, days: int) -> list[dt.date]:


def get_query_value_from_request(
request: HttpRequest, key: str, type_: type, fallback: int
request: HttpRequest, key: str, type_: type, fallback: Any
) -> Any:
"""Return given query value from the query params"""
if (query_value := request.GET.get(key, _NOT_FOUND)) == _NOT_FOUND:
Expand Down

0 comments on commit f142b47

Please sign in to comment.