mirror of
https://github.com/flibusta-apps/services_manager_server.git
synced 2025-12-06 12:35:39 +01:00
Migrate to ruff
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from fastapi import Security, HTTPException, status
|
||||
from fastapi import HTTPException, Security, status
|
||||
|
||||
from core.auth import default_security
|
||||
from core.config import env_config
|
||||
|
||||
@@ -3,7 +3,7 @@ from enum import Enum
|
||||
|
||||
import ormar
|
||||
|
||||
from core.db import metadata, database
|
||||
from core.db import database, metadata
|
||||
|
||||
|
||||
class BaseMeta(ormar.ModelMeta):
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, constr
|
||||
|
||||
from app.models import Statuses, CachePrivileges
|
||||
from app.models import CachePrivileges, Statuses
|
||||
|
||||
|
||||
class ServiceCreate(BaseModel):
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from fastapi import APIRouter, HTTPException, status, Depends
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
|
||||
from app.depends import check_token
|
||||
from app.models import CachePrivileges, Service, Statuses
|
||||
from app.serializers import ServiceCreate, ServiceDetail
|
||||
|
||||
|
||||
# TODO: add redis cache
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
import sentry_sdk
|
||||
from fastapi import FastAPI
|
||||
|
||||
from app.views import router
|
||||
from core.config import env_config
|
||||
from core.db import database
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_DSN,
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from fastapi.security import APIKeyHeader
|
||||
|
||||
|
||||
default_security = APIKeyHeader(name="Authorization")
|
||||
|
||||
@@ -5,7 +5,6 @@ from sqlalchemy import MetaData
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
DATABASE_URL = (
|
||||
f"postgresql://{env_config.POSTGRES_USER}:{quote(env_config.POSTGRES_PASSWORD)}@"
|
||||
f"{env_config.POSTGRES_HOST}:{env_config.POSTGRES_PORT}/{env_config.POSTGRES_DB}"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from core.app import start_app
|
||||
|
||||
|
||||
app = start_app()
|
||||
|
||||
Reference in New Issue
Block a user