Skip to content

fix: Linter and formatter failures #424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion supertokens_python/recipe/dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import annotations

from typing import Callable, Optional, Union, TYPE_CHECKING
from typing import Callable, Optional, Union

from supertokens_python import AppInfo, RecipeModule

Expand Down
16 changes: 12 additions & 4 deletions supertokens_python/recipe/multitenancy/recipe_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ async def get_tenant(
self, tenant_id: Optional[str], user_context: Dict[str, Any]
) -> Optional[GetTenantOkResult]:
res = await self.querier.send_get_request(
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant"),
NormalisedURLPath(
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant"
),
)

if res["status"] == "TENANT_NOT_FOUND_ERROR":
Expand Down Expand Up @@ -210,7 +212,9 @@ async def create_or_update_third_party_config(
user_context: Dict[str, Any],
) -> CreateOrUpdateThirdPartyConfigOkResult:
response = await self.querier.send_put_request(
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/config/thirdparty"),
NormalisedURLPath(
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/config/thirdparty"
),
{
"config": config.to_json(),
"skipValidation": skip_validation is True,
Expand Down Expand Up @@ -250,7 +254,9 @@ async def associate_user_to_tenant(
AssociateUserToTenantThirdPartyUserAlreadyExistsError,
]:
response: Dict[str, Any] = await self.querier.send_post_request(
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user"),
NormalisedURLPath(
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user"
),
{
"userId": user_id,
},
Expand Down Expand Up @@ -281,7 +287,9 @@ async def dissociate_user_from_tenant(
self, tenant_id: Optional[str], user_id: str, user_context: Dict[str, Any]
) -> DisassociateUserFromTenantOkResult:
response = await self.querier.send_post_request(
NormalisedURLPath(f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user/remove"),
NormalisedURLPath(
f"{tenant_id or DEFAULT_TENANT_ID}/recipe/multitenancy/tenant/user/remove"
),
{
"userId": user_id,
},
Expand Down
7 changes: 2 additions & 5 deletions supertokens_python/recipe/session/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import annotations
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union, TYPE_CHECKING
from typing import Any, Callable, Dict, List, Optional, TypeVar, Union

from supertokens_python.recipe.openid.interfaces import (
GetOpenIdDiscoveryConfigurationResult,
Expand Down Expand Up @@ -47,12 +47,9 @@

_T = TypeVar("_T")

if TYPE_CHECKING:
from supertokens_python.framework.request import BaseRequest


async def create_new_session(
request: BaseRequest,
request: Any,
tenant_id: str,
user_id: str,
access_token_payload: Union[Dict[str, Any], None] = None,
Expand Down
8 changes: 2 additions & 6 deletions supertokens_python/recipe/session/syncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import annotations
from typing import Any, Dict, List, Union, Callable, Optional, TypeVar, TYPE_CHECKING
from typing import Any, Dict, List, Union, Callable, Optional, TypeVar

from supertokens_python.async_to_sync_wrapper import sync
from supertokens_python.recipe.openid.interfaces import (
Expand All @@ -37,12 +37,8 @@
)


if TYPE_CHECKING:
from supertokens_python.framework.request import BaseRequest


def create_new_session(
request: BaseRequest,
request: Any,
tenant_id: str,
user_id: str,
access_token_payload: Union[Dict[str, Any], None] = None,
Expand Down
14 changes: 6 additions & 8 deletions tests/auth-react/fastapi-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,9 @@ async def authorisation_url_get(
passwordless_init = passwordless.init(
contact_config=ContactEmailOnlyConfig(),
flow_type=flow_type,
email_delivery=passwordless.EmailDeliveryConfig(CustomPlessEmailService()),
email_delivery=passwordless.EmailDeliveryConfig(
CustomPlessEmailService()
),
override=passwordless.InputOverrideConfig(
apis=override_passwordless_apis
),
Expand All @@ -923,7 +925,9 @@ async def authorisation_url_get(
contact_config=ContactEmailOnlyConfig(),
flow_type=flow_type,
providers=providers_list,
email_delivery=passwordless.EmailDeliveryConfig(CustomPlessEmailService()),
email_delivery=passwordless.EmailDeliveryConfig(
CustomPlessEmailService()
),
override=thirdpartypasswordless.InputOverrideConfig(
apis=override_thirdpartypasswordless_apis
),
Expand Down Expand Up @@ -1141,12 +1145,6 @@ async def check_role_api(
return JSONResponse({"status": "OK"})



@app.get("/hello")
async def check_role_api():
return JSONResponse({"msg": "hello world!"})


@app.exception_handler(405) # type: ignore
def f_405(_, e): # type: ignore
return PlainTextResponse("", status_code=404)
Expand Down
4 changes: 3 additions & 1 deletion tests/auth-react/flask-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,9 @@ async def authorisation_url_get(
contact_config=ContactPhoneOnlyConfig(),
flow_type="USER_INPUT_CODE_AND_MAGIC_LINK",
providers=providers_list,
email_delivery=thirdpartypasswordless.EmailDeliveryConfig(CustomPlessEmailService()),
email_delivery=thirdpartypasswordless.EmailDeliveryConfig(
CustomPlessEmailService()
),
sms_delivery=thirdpartypasswordless.SMSDeliveryConfig(CustomSMSService()),
override=thirdpartypasswordless.InputOverrideConfig(
apis=override_thirdpartypasswordless_apis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import json

from fastapi import FastAPI
from pytest import mark, fixture

Expand Down