Skip to content

Commit

Permalink
[18.0][MIG] endpoint_route_handler: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BertVGroenendael committed Nov 20, 2024
1 parent 2a7f6ad commit ce53117
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions endpoint_route_handler/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Contributors

- Simone Orsi <simone.orsi@camptocamp.com>
- Nguyen Minh Chien <chien@trobz.com>
- Bert Van Groenendael <bert.vangroenendael@dynapps.eu>

Maintainers
-----------
Expand Down
8 changes: 4 additions & 4 deletions endpoint_route_handler/models/endpoint_route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import logging

from odoo import _, api, exceptions, fields, models
from odoo import api, exceptions, fields, models

ENDPOINT_ROUTE_CONSUMER_MODELS = {
# by db
Expand Down Expand Up @@ -79,7 +79,7 @@ def _check_route_unique_across_models(self):
clashing_models.append(model)
if clashing_models:
raise exceptions.UserError(
_(
self.env._(
"Non unique route(s): %(routes)s.\n"
"Found in model(s): %(models)s.\n"
)
Expand Down Expand Up @@ -176,7 +176,7 @@ def _check_route(self):
for rec in self:
if rec.route in self._blacklist_routes:
raise exceptions.UserError(
_("`%(name)s` uses a blacklisted routed = `%(route)s`")
self.env._("`%(name)s` uses a blacklisted routed = `%(route)s`")
% {"name": rec.name, "route": rec.route}
)

Expand All @@ -185,7 +185,7 @@ def _check_request_method(self):
for rec in self:
if rec.request_method in ("POST", "PUT") and not rec.request_content_type:
raise exceptions.UserError(
_("Request content type is required for POST and PUT.")
self.env._("Request content type is required for POST and PUT.")
)

def _prepare_endpoint_rules(self, options=None):
Expand Down
1 change: 1 addition & 0 deletions endpoint_route_handler/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Simone Orsi \<<simone.orsi@camptocamp.com>\>
- Nguyen Minh Chien \<<chien@trobz.com>\>
- Bert Van Groenendael \<<bert.vangroenendael@dynapps.eu>\>
1 change: 1 addition & 0 deletions endpoint_route_handler/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<ul class="simple">
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
<li>Nguyen Minh Chien &lt;<a class="reference external" href="mailto:chien&#64;trobz.com">chien&#64;trobz.com</a>&gt;</li>
<li>Bert Van Groenendael &lt;<a class="reference external" href="mailto:bert.vangroenendael&#64;dynapps.eu">bert.vangroenendael&#64;dynapps.eu</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
3 changes: 2 additions & 1 deletion endpoint_route_handler/tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from contextlib import contextmanager

import odoo
from odoo.modules.registry import Registry
from odoo.tools import mute_logger

from ..registry import EndpointRegistry
Expand All @@ -14,7 +15,7 @@
@contextmanager
def new_rollbacked_env():
# Borrowed from `component`
registry = odoo.registry(odoo.tests.common.get_db_name())
registry = Registry(odoo.tests.common.get_db_name())
uid = odoo.SUPERUSER_ID
cr = registry.cursor()
try:
Expand Down

0 comments on commit ce53117

Please sign in to comment.