Skip to content

Commit

Permalink
fix: Convert invariant List to Sequence
Browse files Browse the repository at this point in the history
This makes a new version of mypy happy.
  • Loading branch information
zusorio authored and MoritzWeber0 committed Nov 29, 2024
1 parent 79b8796 commit 1d8e55a
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 81 deletions.
61 changes: 31 additions & 30 deletions backend/capellacollab/settings/configuration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import enum
import typing as t
import zoneinfo
from collections import abc as collections_abc

import pydantic
from croniter import croniter
Expand Down Expand Up @@ -69,40 +70,40 @@ class CustomNavbarLink(NavbarLink):


class NavbarConfiguration(core_pydantic.BaseModelStrict):
external_links: list[BuiltInNavbarLink | CustomNavbarLink] = (
pydantic.Field(
default=(
external_links: collections_abc.Sequence[
BuiltInNavbarLink | CustomNavbarLink
] = pydantic.Field(
default=(
[
BuiltInNavbarLink(
name="Grafana",
service=BuiltInLinkItem.GRAFANA,
role=users_models.Role.ADMIN,
),
BuiltInNavbarLink(
name="Prometheus",
service=BuiltInLinkItem.PROMETHEUS,
role=users_models.Role.ADMIN,
),
BuiltInNavbarLink(
name="Documentation",
service=BuiltInLinkItem.DOCUMENTATION,
role=users_models.Role.USER,
),
]
+ (
[
BuiltInNavbarLink(
name="Grafana",
service=BuiltInLinkItem.GRAFANA,
role=users_models.Role.ADMIN,
),
BuiltInNavbarLink(
name="Prometheus",
service=BuiltInLinkItem.PROMETHEUS,
role=users_models.Role.ADMIN,
),
BuiltInNavbarLink(
name="Documentation",
service=BuiltInLinkItem.DOCUMENTATION,
name="SMTP Mock",
service=BuiltInLinkItem.SMTP_MOCK,
role=users_models.Role.USER,
),
)
]
+ (
[
BuiltInNavbarLink(
name="SMTP Mock",
service=BuiltInLinkItem.SMTP_MOCK,
role=users_models.Role.USER,
)
]
if core.DEVELOPMENT_MODE
else []
)
),
description="Links to display in the navigation bar.",
)
if core.DEVELOPMENT_MODE
else []
)
),
description="Links to display in the navigation bar.",
)


Expand Down
2 changes: 1 addition & 1 deletion backend/capellacollab/tools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ToolSessionEnvironment(core_pydantic.BaseModel):
"'after' runs after the environment variable is JSON serialized, allowing to access a dict in the JSON format. "
),
)
value: str = pydantic.Field(
value: dict[str, str] = pydantic.Field(
default={"RMT_PASSWORD": "{CAPELLACOLLAB_SESSION_TOKEN}"},
description=(
"Environment variables, which are mounted into session containers. "
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1d8e55a

Please sign in to comment.