paper-dynasty-database/app/routers_v2/admin.py
Cal Corum bcdbf2add1 fix: remove unused imports in PR #33 files
Removed 55 unused imports across 26 router files. Most were `db` imports
left over after the db.close() removal in the previous commit, plus
additional stale imports (scipy.stats, chunked, copy, base64, Html2Image,
pandas.DataFrame, pydantic.validator, etc.) that were already unused.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 15:52:56 -06:00

34 lines
956 B
Python

from fastapi import APIRouter, Depends, HTTPException
import logging
from ..db_engine import Player
from ..dependencies import oauth2_scheme, valid_token, LOG_DATA, PRIVATE_IN_SCHEMA
logging.basicConfig(
filename=LOG_DATA['filename'],
format=LOG_DATA['format'],
level=LOG_DATA['log_level']
)
router = APIRouter(
prefix='/api/v2/admin',
tags=['Admin']
)
@router.post('/stl-fix', include_in_schema=PRIVATE_IN_SCHEMA)
async def stl_cardinals_fix(token: str = Depends(oauth2_scheme)):
if not valid_token(token):
logging.warning(f'Bad Token: {token}')
raise HTTPException(
status_code=401,
detail='You are not authorized to post. This event has been logged.'
)
p_query = Player.update(mlbclub='St Louis Cardinals', franchise='St Louis Cardinals').where(
Player.mlbclub == 'St. Louis Cardinals'
).execute()
return {'detail': f'Removed the period from St Louis'}