Skip to content

Commit

Permalink
Merge branch 'async-workers' of github.com:canonical/paas-charm into …
Browse files Browse the repository at this point in the history
…async-workers
  • Loading branch information
alithethird committed Nov 27, 2024
2 parents 10a314b + 231ecc7 commit 80146a0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ Applicable spec: <link>
- [ ] The documentation is generated using `src-docs`
- [ ] The documentation for charmhub is updated
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`)
- [ ] The [changelog](../CHANGELOG.md) has been updated

<!-- Explanation for any unchecked items above -->
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cosl
jsonschema >=4.19,<4.20
ops >= 2.6
pydantic==2.9.2
pydantic==2.10.1
2 changes: 1 addition & 1 deletion src/paas_charm/django/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DjangoConfig(FrameworkConfig):

debug: bool | None = Field(alias="django-debug", default=None)
secret_key: str | None = Field(alias="django-secret-key", default=None, min_length=1)
allowed_hosts: str | None = Field(alias="django-allowed-hosts", default=[])
allowed_hosts: str | list[str] | None = Field(alias="django-allowed-hosts", default=[])

model_config = ConfigDict(extra="ignore")

Expand Down
6 changes: 4 additions & 2 deletions src/paas_charm/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def secret_key_id(cls, data: dict[str, str | int | bool | dict[str, str] | None]
"""
# Bandit thinks the following are secrets which they are not
secret_key_field = "secret_key" # nosec B105
if secret_key_field not in cls.model_fields:
# Mypy thinks model_fields does not have get attribute
if not cls.model_fields.get(secret_key_field, None): # type: ignore
secret_key_field = "app_secret_key" # nosec B105
secret_key_config_name = cls.model_fields[secret_key_field].alias
# Mypy thinks model_fields does not have get attribute
secret_key_config_name = cls.model_fields.get(secret_key_field).alias # type: ignore
if not secret_key_config_name:
raise NotImplementedError("framework configuration secret_key field has no alias")
secret_key_id_config_name = f"{secret_key_config_name}-id"
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ deps =
cosl
boto3
juju==3.5.2.0
websockets < 14.0
websockets<14.0 # https://github.com/juju/python-libjuju/issues/1184
git+https://github.com/canonical/saml-test-idp.git
-r{toxinidir}/requirements.txt
-r{toxinidir}/tests/integration/flask/requirements.txt
Expand Down

0 comments on commit 80146a0

Please sign in to comment.