From 1a0b4dc25db9a8e588a46438db966cbcc361b79c Mon Sep 17 00:00:00 2001 From: nathanb Date: Mon, 4 May 2026 22:14:10 +0100 Subject: [PATCH] Add member profile questions, admin tooling, legal pages, and fast tests - Add configurable profile questions with conditional visibility, admin-only fields, user answers, and seeded onboarding/volunteer questions - Add admin UI for managing profile questions and member profile answers - Add volunteer level/profile data support across backend schemas, models, API, and migration - Update dashboard/profile UI, super admin menu, membership service types, and related styling - Add privacy policy, terms of service, cookie notice, and footer links - Add frontend Vitest coverage for profile question logic - Add backend pytest coverage for profile answer normalization and validation - Update restart.sh to build, run frontend/backend unit tests, and restart only after tests pass - Refresh README, quickstart, project structure, instructions, and Square docs to match current app features - Protect feature flag reload behind super-admin access - Restrict admin-triggered password resets so admins can only reset member accounts - Replace email template HTML preview rendering with escaped text preview - Update docs for feature flag reload access, password reset scope, and email template preview safety -- test user questions are also made by AI and not very useful. but i didn't know what to put there so its good enough for a test -- all tests pass on my vm and seems to run fine --- .gitignore | 1 + backend/app/core/config.py | 17 ++++++++++++----- backend/app/core/database.py | 3 +-- backend/requirements.txt | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 60b54fb..cd0bfab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__/ .Python env/ venv/ +.venv/ ENV/ build/ develop-eggs/ diff --git a/backend/app/core/config.py b/backend/app/core/config.py index c57c722..8eac399 100644 --- a/backend/app/core/config.py +++ b/backend/app/core/config.py @@ -1,6 +1,11 @@ -from pydantic_settings import BaseSettings +from pathlib import Path from typing import List -import os + +from pydantic_settings import BaseSettings, SettingsConfigDict + + +PROJECT_ROOT = Path(__file__).resolve().parents[3] +BACKEND_ROOT = Path(__file__).resolve().parents[2] class Settings(BaseSettings): @@ -47,9 +52,11 @@ class Settings(BaseSettings): UPLOAD_DIR: str = "/app/uploads" MAX_UPLOAD_SIZE: int = 10485760 # 10MB - class Config: - env_file = ".env" - case_sensitive = True + model_config = SettingsConfigDict( + env_file=(PROJECT_ROOT / ".env", BACKEND_ROOT / ".env", ".env"), + case_sensitive=True, + extra="ignore", + ) settings = Settings() diff --git a/backend/app/core/database.py b/backend/app/core/database.py index 2090286..4571f78 100644 --- a/backend/app/core/database.py +++ b/backend/app/core/database.py @@ -1,6 +1,5 @@ from sqlalchemy import create_engine -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.orm import sessionmaker +from sqlalchemy.orm import declarative_base, sessionmaker from .config import settings engine = create_engine( diff --git a/backend/requirements.txt b/backend/requirements.txt index 671bf43..aa03d8b 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -6,7 +6,7 @@ pydantic-settings==2.6.1 python-multipart==0.0.6 # Database -sqlalchemy==2.0.23 +sqlalchemy==2.0.49 pymysql==1.1.0 cryptography==41.0.7 alembic==1.13.0