Skip to content

Commit

Permalink
fix: remove min length and change docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
amandahla committed Nov 8, 2024
1 parent 9bcb85c commit 8cc3f52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/charm_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class GithubActionsExporterConfig(BaseModel): # pylint: disable=too-few-public-
github_webhook_token: github_webhook_token config.
"""

github_api_token: str = Field(None, min_length=1)
github_org: str = Field(None, min_length=1)
github_api_token: str = Field(None)
github_org: str = Field(None)
github_webhook_token: str = Field(..., min_length=1)

class Config: # pylint: disable=too-few-public-methods
Expand Down
3 changes: 2 additions & 1 deletion src/github_actions_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def is_configuration_valid(state: CharmState) -> bool:
state: The state of the charm.
Returns:
True if they are all set
True if all configs are set, github_webhook_token is set or
github_api_token and github_org are set.
"""
return state.github_webhook_token or all([state.github_api_token, state.github_org])

Expand Down

0 comments on commit 8cc3f52

Please sign in to comment.