46 lines
1.6 KiB
Markdown
46 lines
1.6 KiB
Markdown
---
|
|
id: 650babda-b99b-4017-92b7-692bada7669d
|
|
type: fix
|
|
title: "Fix: Inverted TESTING env check in paper-dynasty-database dependencies.py"
|
|
tags: [paper-dynasty-database, python, fastapi, env, fix, bug]
|
|
importance: 0.5
|
|
confidence: 0.8
|
|
created: "2026-03-03T21:22:08.248652+00:00"
|
|
updated: "2026-03-03T21:22:09.788800+00:00"
|
|
relations:
|
|
- target: 04e57a23-0a20-49d6-8c5a-2fa5fc4e55b5
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.72
|
|
edge_id: d2bdb6b1-395e-4740-a402-b588331b72ba
|
|
- target: 1e6628fa-dc5d-4047-a9ae-ecb884e04ba2
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.72
|
|
edge_id: 7f2a9e26-50c9-4191-8372-14807b170e0e
|
|
- target: d36a86f0-8183-4c94-8d63-0be65d3fd63a
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.71
|
|
edge_id: dd92b372-5e87-4cfe-9e5c-f97b09c0104b
|
|
---
|
|
|
|
## Problem
|
|
`app/dependencies.py:33` had `if os.environ.get('TESTING') == 'False':` — inverted logic that only switched to the dev URL when TESTING was False. Also, `.env` had ` TESTING=TRUE` with a leading space, so the env var was never actually set (key was ` TESTING` not `TESTING`).
|
|
|
|
## Root Cause
|
|
- Inverted string comparison (`'False'` instead of `'True'`)
|
|
- Leading space in `.env` key name silently prevented the var from loading
|
|
|
|
## Solution
|
|
- `dependencies.py:33`: `== 'False'` → `== 'True'`
|
|
- `.env:64`: ` TESTING=TRUE` → `TESTING=True` (remove leading space, normalize case to match comparison)
|
|
- Updated `.env` comment from "Set to 'False'" to "Set to 'True'"
|
|
|
|
## Files Changed
|
|
- `app/dependencies.py`
|
|
- `.env`
|
|
|
|
## PR
|
|
https://git.manticorum.com/cal/paper-dynasty-database/pulls/40 (issue #23)
|