Skip to content

Commit

Permalink
remove CompositionView (#10590) (#10762)
Browse files Browse the repository at this point in the history
* Remove CompositionView

CompositionView has been deprecated

Co-authored-by: Tayfun Sen <[email protected]>

Co-authored-by: Juan Felipe Carmona <[email protected]>
  • Loading branch information
Tayfun Sen and jfcarmonag authored Jan 28, 2022
1 parent 43a1102 commit ad8e541
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog/10590.removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed CompositionView.
11 changes: 1 addition & 10 deletions rasa/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ad8e541

Please sign in to comment.