wow, thats pretty ruff
ran 'ruff check --fix app'
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlmodel import Session, select
|
||||
from sqlalchemy.orm import selectinload
|
||||
from typing import List
|
||||
from sqlmodel import Session, select
|
||||
|
||||
from app.model.models import *
|
||||
from app.services.database import engine, get_session, add_and_refresh
|
||||
from app.services.auth import auth_is_admin
|
||||
import uuid as gen_uuid
|
||||
from app.services.database import add_and_refresh, get_session
|
||||
|
||||
aa_router = APIRouter(prefix="/api/v1/aa", tags=["AccessAuth"])
|
||||
|
||||
@aa_router.post("/", response_model=AccessAuthorizationResponse)
|
||||
def add_accessauth(*, db: Session = Depends(get_session), aa: AccessAuthorizationCreate, admin: bool = Depends(auth_is_admin)):
|
||||
logger.info(f"Creating accessauth with data: {aa}")
|
||||
if aa.timetables is not []:
|
||||
if aa.timetables != []:
|
||||
timetables = [Timetable.model_validate(t) for t in aa.timetables]
|
||||
else: timetables = []
|
||||
if aa.oneshot is not None:
|
||||
@@ -30,7 +30,7 @@ def add_accessauth(*, db: Session = Depends(get_session), aa: AccessAuthorizatio
|
||||
)
|
||||
return add_and_refresh(db, db_aa)
|
||||
|
||||
@aa_router.get("/", response_model=List[AccessAuthorizationResponse])
|
||||
@aa_router.get("/", response_model=list[AccessAuthorizationResponse])
|
||||
def get_all_accessauths(db: Session = Depends(get_session), admin: bool = Depends(auth_is_admin)):
|
||||
return db.exec(
|
||||
select(AccessAuthorizationDB)
|
||||
|
||||
Reference in New Issue
Block a user