From cc660f9ffbc22ab4c637e3127a577c016031478c Mon Sep 17 00:00:00 2001 From: michael7nightingale Date: Wed, 9 Aug 2023 11:32:25 +0500 Subject: [PATCH] correct flake8 errors --- src/apps/cabinets/models.py | 2 -- src/apps/users/api_routes.py | 2 +- src/apps/users/dependencies.py | 2 +- src/apps/users/oauth/github.py | 2 +- src/apps/users/routes.py | 3 +-- src/core/config.py | 2 +- src/services/email.py | 1 - 7 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/apps/cabinets/models.py b/src/apps/cabinets/models.py index b92fb4b..02e16d3 100644 --- a/src/apps/cabinets/models.py +++ b/src/apps/cabinets/models.py @@ -1,5 +1,3 @@ -from uuid import uuid4 - from tortoise import fields from src.base.models import TortoiseModel diff --git a/src/apps/users/api_routes.py b/src/apps/users/api_routes.py index b6448a9..caa1528 100644 --- a/src/apps/users/api_routes.py +++ b/src/apps/users/api_routes.py @@ -7,7 +7,7 @@ from .dependencies import get_oauth_provider from .models import User -from .oauth import GoogleOAuthProvider, GithubOAuthProvider, Providers +from .oauth import Providers from .schemas import UserRegister, UserCustomModel from src.core.config import get_app_settings from src.services.token import confirm_token, generate_activation_link diff --git a/src/apps/users/dependencies.py b/src/apps/users/dependencies.py index 14dc793..3268d50 100644 --- a/src/apps/users/dependencies.py +++ b/src/apps/users/dependencies.py @@ -1,4 +1,4 @@ -from fastapi import Form, Path +from fastapi import Form from .oauth import Providers, get_provider, BaseProvider from .schemas import UserRegister diff --git a/src/apps/users/oauth/github.py b/src/apps/users/oauth/github.py index 1ad60e8..59d7020 100644 --- a/src/apps/users/oauth/github.py +++ b/src/apps/users/oauth/github.py @@ -8,7 +8,7 @@ class GithubOAuthProvider(BaseProvider): name = "github" def get_access_token(self) -> str | None: - url = "https://github.com/login/oauth/access_token?client_id={client_id}&client_secret={client_secret}&code={code}".format( + url = "https://github.com/login/oauth/access_token?client_id={client_id}&client_secret={client_secret}&code={code}".format( # noqa: E501 client_secret=self.client_secret, client_id=self.client_id, code=self.code diff --git a/src/apps/users/routes.py b/src/apps/users/routes.py index 32157a0..feaa478 100644 --- a/src/apps/users/routes.py +++ b/src/apps/users/routes.py @@ -1,12 +1,11 @@ from fastapi import APIRouter, Form, Request, Depends from fastapi.templating import Jinja2Templates from fastapi.responses import RedirectResponse -import requests from tortoise.exceptions import IntegrityError from .dependencies import get_user_register_data, get_oauth_provider from .models import User -from .oauth import GithubOAuthProvider, GoogleOAuthProvider, Providers +from .oauth import Providers from .schemas import UserRegister, UserCustomModel from src.core.config import get_app_settings from src.services.token import confirm_token, generate_activation_link diff --git a/src/core/config.py b/src/core/config.py index 137e0d0..57918b1 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -28,7 +28,7 @@ def github_login_url(self) -> str: @property def google_login_url(self) -> str: - return "{token_request_uri}?response_type={response_type}&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}".format( + return "{token_request_uri}?response_type={response_type}&client_id={client_id}&redirect_uri={redirect_uri}&scope={scope}".format( # noqa: E501 token_request_uri="https://accounts.google.com/o/oauth2/auth", response_type="code", client_id=self.GOOGLE_CLIENT_ID, diff --git a/src/services/email.py b/src/services/email.py index a822195..deef6d8 100644 --- a/src/services/email.py +++ b/src/services/email.py @@ -1,5 +1,4 @@ from smtplib import SMTP_SSL -from src.core.config import get_app_settings class SMTPServer(SMTP_SSL):