diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a80be56b..e3b5129a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -77,13 +77,13 @@ repos: hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v3.1.0 hooks: - id: prettier name: prettier (with plugin-xml) additional_dependencies: - - "prettier@2.7.1" - - "@prettier/plugin-xml@2.2.0" + - "prettier@3.1.0" + - "@prettier/plugin-xml@3.3.1" args: - --plugin=@prettier/plugin-xml files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ @@ -123,7 +123,7 @@ repos: - id: pyupgrade args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort except __init__.py @@ -141,13 +141,13 @@ repos: - --header - "# generated from manifests external_dependencies" - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 7.0.0 hooks: - id: flake8 name: flake8 - additional_dependencies: ["flake8-bugbear==21.9.2"] + additional_dependencies: ["flake8-bugbear==24.2.6"] - repo: https://github.com/OCA/pylint-odoo - rev: v8.0.19 + rev: v9.0.5 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/.prettierrc.yml b/.prettierrc.yml index 5b6d4b36..bfdff106 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -6,3 +6,4 @@ proseWrap: always semi: true trailingComma: "es5" xmlWhitespaceSensitivity: "strict" +plugins: ["@prettier/plugin-xml"] diff --git a/auth_partner/models/auth_directory.py b/auth_partner/models/auth_directory.py index afe997ad..5a862ca0 100644 --- a/auth_partner/models/auth_directory.py +++ b/auth_partner/models/auth_directory.py @@ -147,6 +147,8 @@ def _send_mail_impl(self, type_or_template, auth_partner, **context): return f"Mail {template.name} sent to {auth_partner.login}" def _generate_token(self, action, auth_partner, expiration_delta, key_salt=""): + # We need to sudo here as secret_key is a protected field + self = self.sudo() return jwt.encode( { "exp": datetime.now(tz=timezone.utc) + expiration_delta,