Skip to content

Commit

Permalink
(backend) linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Alexandre35 committed Oct 27, 2024
1 parent 986d496 commit 4b1115a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 17 deletions.
4 changes: 1 addition & 3 deletions travian/backend/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from fastapi import FastAPI, Depends, Response
from fastapi import FastAPI
from fastapi.responses import RedirectResponse
from src.api.v1.village import village_router
from src.api.v1.auth import auth_router
from src.core.auth import get_current_user
from src.core.config import *
from fastapi.middleware.cors import CORSMiddleware


Expand Down
2 changes: 0 additions & 2 deletions travian/backend/src/api/v1/village.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
from src.core.auth import get_current_user
from src.db.services.village import (
create_village,
get_village_infos,
get_user_villages,
)
from src.db.utils import get_db
from src.db.schemas.villages import NewVillage, NewVillageRequest, UserVillages

village_router = village = APIRouter()
Expand Down
2 changes: 1 addition & 1 deletion travian/backend/src/core/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from jose import JWTError, jwt
from jose import jwt
from fastapi import Depends
from src.db.services.user import create_user, get_user_by_email, user_exits
from src.db.schemas.user import UserCreate, UserJWTToken
Expand Down
3 changes: 0 additions & 3 deletions travian/backend/src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
from dotenv import load_dotenv

load_dotenv(dotenv_path="local.env")
print(
"123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789"
)

# FastAPI
AUTH_TOKEN_ALGO = "HS256"
Expand Down
1 change: 0 additions & 1 deletion travian/backend/src/core/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import hmac
from datetime import datetime, timedelta
import jwt
from fastapi.security import OAuth2PasswordBearer
from src.core.config import SECRET_KEY, AUTH_TOKEN_ALGO


Expand Down
3 changes: 0 additions & 3 deletions travian/backend/src/core/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class UserAuth(BaseModel):
salt: bytes


ß


class id(BaseModel):
"""current authenticated User data stored in the JWT Web Token"""

Expand Down
1 change: 0 additions & 1 deletion travian/backend/src/db/schemas/villages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# pylint: disable=no-name-in-module, too-few-public-methods
from turtle import position
from typing import Optional

from pydantic import BaseModel, Field
Expand Down
10 changes: 7 additions & 3 deletions travian/backend/src/db/services/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ def create_user(
is_active = True
is_superuser = False
sql = """
INSERT INTO transactions.users (uuid, email, active, superuser, created_on, password, password_salt, tribe_id)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s)
"""
INSERT INTO transactions.users (
uuid, email, active, superuser, created_on,
password, password_salt, tribe_id
) VALUES (
%s, %s, %s, %s, %s, %s, %s, %s
)
"""
params = (
uuid,
user.email,
Expand Down

0 comments on commit 4b1115a

Please sign in to comment.