Compare commits

..

6 Commits

Author SHA1 Message Date
Cal Corum
9fc7a9449e fix: correct inverted TESTING env check and leading space in .env (#23)
- Change `== 'False'` to `== 'True'` so TESTING=True routes to dev URL
- Fix leading space on TESTING=TRUE in .env so the var is actually set
- Update .env comment to match corrected logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 21:43:54 +00:00
cal
7b18962033 Merge pull request 'fix: respect is_ai=False in get_teams filter (#22)' (#41) from ai/paper-dynasty-database#22 into next-release
Reviewed-on: #41
2026-03-03 21:42:00 +00:00
Cal Corum
3e15acbb9d fix: respect is_ai=False in get_teams filter (#22)
`all_teams.where(Team.is_ai)` always filtered for AI teams regardless
of the caller's intent. Match the existing has_guide pattern and use
explicit boolean comparison so False is handled correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 21:38:50 +00:00
Cal Corum
2a660e9c19 docs: add next-release branch workflow to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:56:03 -06:00
cal
4a4ed0ff2b Merge pull request 'fix: remove debug print(req.scope) from get_docs route (#31)' (#32) from ai/paper-dynasty-database#31 into next-release
Reviewed-on: #32
2026-03-03 16:52:38 +00:00
Cal Corum
65ad72c299 fix: remove debug print(req.scope) from get_docs route (#31)
All checks were successful
Build Docker Image / build (pull_request) Successful in 9m50s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 22:36:15 -06:00
3 changed files with 48 additions and 10 deletions

View File

@ -51,6 +51,13 @@ docker build -t paper-dynasty-db . # Build image
- DB connection errors → verify `POSTGRES_HOST` points to correct container name
- **CI/CD**: Gitea Actions on PR to `main` — builds Docker image, auto-generates CalVer version (`YYYY.MM.BUILD`) on merge
### Release Workflow
1. Create feature/fix branches off `next-release` (e.g., `fix/card-pricing`)
2. When done, merge the branch into `next-release` — this is the staging branch where changes accumulate
3. When ready to release, open a PR from `next-release``main`
4. CI builds Docker image on PR; CalVer tag is created on merge
5. Deploy the new image to production
## Important
- Docker image installs only Playwright Chromium (not all browsers) to optimize size

View File

@ -6,15 +6,42 @@ from fastapi.openapi.utils import get_openapi
# from fastapi.templating import Jinja2Templates
from .routers_v2 import (
current, awards, teams, rarity, cardsets, players, packtypes, packs, cards, events, results, rewards, decisions,
batstats, pitstats, notifications, paperdex, gamerewards, gauntletrewards, gauntletruns, battingcards,
battingcardratings, pitchingcards, pitchingcardratings, cardpositions, scouting, mlbplayers, stratgame, stratplays)
current,
awards,
teams,
rarity,
cardsets,
players,
packtypes,
packs,
cards,
events,
results,
rewards,
decisions,
batstats,
pitstats,
notifications,
paperdex,
gamerewards,
gauntletrewards,
gauntletruns,
battingcards,
battingcardratings,
pitchingcards,
pitchingcardratings,
cardpositions,
scouting,
mlbplayers,
stratgame,
stratplays,
)
app = FastAPI(
# root_path='/api',
responses={404: {'description': 'Not found'}},
docs_url='/api/docs',
redoc_url='/api/redoc'
responses={404: {"description": "Not found"}},
docs_url="/api/docs",
redoc_url="/api/redoc",
)
# app.mount("/static", StaticFiles(directory="storage/static"), name="static")
@ -53,10 +80,11 @@ app.include_router(decisions.router)
@app.get("/api/docs", include_in_schema=False)
async def get_docs(req: Request):
print(req.scope)
return get_swagger_ui_html(openapi_url=req.scope.get('root_path')+'/openapi.json', title='Swagger')
return get_swagger_ui_html(
openapi_url=req.scope.get("root_path") + "/openapi.json", title="Swagger"
)
@app.get("/api/openapi.json", include_in_schema=False)
async def openapi():
return get_openapi(title='Paper Dynasty API', version=f'0.1.1', routes=app.routes)
return get_openapi(title="Paper Dynasty API", version=f"0.1.1", routes=app.routes)

View File

@ -150,7 +150,10 @@ async def get_teams(
all_teams = all_teams.where(Team.has_guide == True)
if is_ai is not None:
all_teams = all_teams.where(Team.is_ai)
if not is_ai:
all_teams = all_teams.where(Team.is_ai == False)
else:
all_teams = all_teams.where(Team.is_ai == True)
if event_id is not None:
all_teams = all_teams.where(Team.event_id == event_id)