|
46 | 46 | send_non_200_response_with_message,
|
47 | 47 | )
|
48 | 48 |
|
49 |
| - |
50 | 49 | if TYPE_CHECKING:
|
51 | 50 | from .recipe_module import RecipeModule
|
52 | 51 | from supertokens_python.framework.request import BaseRequest
|
@@ -152,8 +151,6 @@ def __init__(
|
152 | 151 | mode: Union[Literal["asgi", "wsgi"], None],
|
153 | 152 | telemetry: Union[bool, None],
|
154 | 153 | ):
|
155 |
| - from .always_initialised_recipes import DEFAULT_MULTITENANCY_RECIPE |
156 |
| - |
157 | 154 | if not isinstance(app_info, InputAppInfo): # type: ignore
|
158 | 155 | raise ValueError("app_info must be an instance of InputAppInfo")
|
159 | 156 |
|
@@ -189,21 +186,21 @@ def __init__(
|
189 | 186 | "Please provide at least one recipe to the supertokens.init function call"
|
190 | 187 | )
|
191 | 188 |
|
| 189 | + from supertokens_python.recipe.multitenancy.recipe import MultitenancyRecipe |
| 190 | + |
192 | 191 | multitenancy_found = False
|
193 | 192 |
|
194 | 193 | def make_recipe(recipe: Callable[[AppInfo], RecipeModule]) -> RecipeModule:
|
195 | 194 | nonlocal multitenancy_found
|
196 | 195 | recipe_module = recipe(self.app_info)
|
197 |
| - if recipe_module.get_recipe_id() == "multitenancy": |
| 196 | + if recipe_module.get_recipe_id() == MultitenancyRecipe.recipe_id: |
198 | 197 | multitenancy_found = True
|
199 | 198 | return recipe_module
|
200 | 199 |
|
201 | 200 | self.recipe_modules: List[RecipeModule] = list(map(make_recipe, recipe_list))
|
202 | 201 |
|
203 |
| - if callable(DEFAULT_MULTITENANCY_RECIPE) and not multitenancy_found: |
204 |
| - recipe = DEFAULT_MULTITENANCY_RECIPE( # pylint: disable=not-callable |
205 |
| - self.app_info |
206 |
| - ) |
| 202 | + if not multitenancy_found: |
| 203 | + recipe = MultitenancyRecipe.init()(self.app_info) |
207 | 204 | self.recipe_modules.append(recipe)
|
208 | 205 |
|
209 | 206 | self.telemetry = (
|
|
0 commit comments