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 4125d6d
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 84 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
6 changes: 2 additions & 4 deletions backend/capellacollab/tools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ class ToolSessionEnvironment(core_pydantic.BaseModel):
),
)
value: str = pydantic.Field(
default={"RMT_PASSWORD": "{CAPELLACOLLAB_SESSION_TOKEN}"},
default="{CAPELLACOLLAB_SESSION_TOKEN}",
description=(
"Environment variables, which are mounted into session containers. "
"You can use f-strings to reference other environment variables in the value. "
),
examples=[
{
"MY_TOOL_USERNAME_WITH_PREFIX": "test_{CAPELLACOLLAB_SESSION_REQUESTER_USERNAME}",
}
"test_{CAPELLACOLLAB_SESSION_REQUESTER_USERNAME}",
],
)

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 4125d6d

Please sign in to comment.