diff --git a/auth_api_key/models/auth_api_key.py b/auth_api_key/models/auth_api_key.py index 6b24e9053c..5ce6fe4ed2 100644 --- a/auth_api_key/models/auth_api_key.py +++ b/auth_api_key/models/auth_api_key.py @@ -25,7 +25,8 @@ class AuthApiKey(models.Model): the api key""", ) - _sql_constraints = [("name_uniq", "unique(name)", "Api Key name must be unique.")] + _sql_constraints = [("name_uniq", "unique(name)", + "Api Key name must be unique.")] def _server_env_section_name(self): """Name of the section in the configuration files diff --git a/auth_api_key/models/ir_http.py b/auth_api_key/models/ir_http.py index 13673663b2..aa0310483f 100644 --- a/auth_api_key/models/ir_http.py +++ b/auth_api_key/models/ir_http.py @@ -21,7 +21,8 @@ def _auth_method_api_key(cls): api_key = headers.get("HTTP_API_KEY") if api_key: request.uid = 1 - auth_api_key = request.env["auth.api.key"]._retrieve_api_key(api_key) + auth_api_key = request.env["auth.api.key"]._retrieve_api_key( + api_key) if auth_api_key: # reset _env on the request since we change the uid... # the next call to env will instantiate an new diff --git a/auth_api_key/tests/test_auth_api_key.py b/auth_api_key/tests/test_auth_api_key.py index da5c524817..8315b0f535 100644 --- a/auth_api_key/tests/test_auth_api_key.py +++ b/auth_api_key/tests/test_auth_api_key.py @@ -25,12 +25,13 @@ def setUpClass(cls, *args, **kwargs): def test_lookup_key_from_db(self): demo_user = self.env.ref("base.user_demo") self.assertEqual( - self.env["auth.api.key"]._retrieve_uid_from_api_key("api_key"), demo_user.id - ) + self.env["auth.api.key"]._retrieve_uid_from_api_key("api_key"), + demo_user.id) def test_lookup_key_from_env(self): self.assertEqual( - self.env["auth.api.key"]._retrieve_uid_from_api_key("api_key_from_env"), + self.env["auth.api.key"]._retrieve_uid_from_api_key( + "api_key_from_env"), self.demo_user.id, ) with self.assertRaises(ValidationError): diff --git a/oca_dependencies.txt b/oca_dependencies.txt index e97867066d..ae177d88c8 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,2 @@ -server-env \ No newline at end of file +# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt +server-env