From ad8e5416e152e4ceef52a7f036fce954c1c61309 Mon Sep 17 00:00:00 2001 From: Tayfun Sen Date: Fri, 28 Jan 2022 14:04:58 +0000 Subject: [PATCH] remove CompositionView (#10590) (#10762) * Remove CompositionView CompositionView has been deprecated Co-authored-by: Tayfun Sen Co-authored-by: Juan Felipe Carmona --- changelog/10590.removal.md | 1 + rasa/core/utils.py | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 changelog/10590.removal.md diff --git a/changelog/10590.removal.md b/changelog/10590.removal.md new file mode 100644 index 000000000000..7be422bf06b2 --- /dev/null +++ b/changelog/10590.removal.md @@ -0,0 +1 @@ +Removed CompositionView. diff --git a/rasa/core/utils.py b/rasa/core/utils.py index 0638b36accde..e1e9235ce194 100644 --- a/rasa/core/utils.py +++ b/rasa/core/utils.py @@ -14,7 +14,6 @@ from rasa.core.lock_store import LockStore, RedisLockStore, InMemoryLockStore from rasa.utils.endpoints import EndpointConfig, read_endpoint_config from sanic import Sanic -from sanic.views import CompositionView from socket import SOCK_DGRAM, SOCK_STREAM import rasa.cli.utils as cli_utils @@ -118,15 +117,7 @@ def find_route(suffix: Text, path: Text) -> Optional[Text]: for arg in route._params: options[arg] = f"[{arg}]" - if not isinstance(route.handler, CompositionView): - handlers = [ - (list(route.methods)[0], route.name.replace("rasa.server.", "")) - ] - else: - handlers = [ - (method, find_route(v.__name__, endpoint) or v.__name__) - for method, v in route.handler.handlers.items() - ] + handlers = [(list(route.methods)[0], route.name.replace("rasa.server.", ""))] for method, name in handlers: full_endpoint = "/" + "/".join(endpoint)