- Introduced a new function to determine if a verification link has expired, improving error handling in the email verification process.
- Updated the email verification logic to utilize the new function, enhancing clarity and maintainability of the code.
- Added EmailVerificationBanner component to notify users about unverified email status and provide a resend verification option.
- Introduced VerifyPage for handling email verification via a token in the URL, including success and error handling.
- Updated LoginPage and AccountSettingsPage to allow users to resend verification emails directly from these pages.
- Enhanced API utility with new functions for verifying emails and resending verification requests.
- Updated routing to include the new verification page and improved link structure for verification links.
- Added SMTP_SSL and SMTP_STARTTLS options to .env.example and docker-compose.yml for improved email sending configuration.
- Updated password reset email logic to utilize a new send_email helper function with SSL and STARTTLS support.
- Implemented role assignment for the first registered user or based on ADMIN_BOOTSTRAP_EMAILS during registration, enhancing user management capabilities.
- Enhanced login response to include additional user information such as email, tier, and role.
- Updated profile update logic to restrict access based on user roles and ensure only authorized users can modify profiles.
- Replaced ProfilePage with AccountSettingsPage in routing and updated related components to reflect this change.
- Added new API functions for updating profiles and changing passwords to improve user account management.
- Removed the profile ID from the INSERT statement to align with the database schema, which uses SERIAL for IDs.
- Updated comments for clarity regarding the profile creation process and verification status.
- Added optional DEV_APP_URL and DEV_ALLOWED_ORIGINS to docker-compose.dev-env.yml for improved local development flexibility.
- Updated .env.example to reflect new environment variables for development.
- Modified backend main.py to support rate limiting on authentication routes and improved CORS handling.
- Enhanced deploy-dev.yml to include health checks for the frontend service, ensuring better monitoring during development.
- Added logic to retrieve existing trainer notes if not provided during the update of training units.
- Updated the TrainingCoachPage to include new controls for managing training sessions, including timer functionalities and navigation enhancements.
- Improved user experience with clearer button labels and conditional rendering based on the training session state.
- Updated the SQL query in the training planning module to fetch the primary exercise focus area more efficiently.
- Enhanced error handling in the API utility to provide clearer feedback on potential issues, including CORS and URL errors, improving debugging for developers.
- Updated role permissions to allow trainers and users to create clubs and training groups.
- Modified database insertion logic to reflect the correct role for trainers during registration.
- Enhanced frontend components to display appropriate messages and buttons based on user roles.
- Improved user guidance in the Clubs and Training Planning pages, emphasizing the need for clubs and groups before planning training sessions.
- Incremented application version to 0.8.0 and updated database schema version to 20260428031.
- Introduced support for training plan templates, allowing users to create and manage reusable training structures.
- Enhanced the Training Planning UI to include sections and exercises, improving the organization of training units.
- Updated API endpoints for training plan templates, enabling CRUD operations for better integration with the frontend.
- Improved validation and permission checks for creating training units, ensuring proper access control.
- Introduced role-based upload limits for exercise media, allowing users to upload up to 1 MB while admins and superadmins can upload up to 1024 MB.
- Updated the media upload logic to enforce these limits, enhancing the flexibility and control over media management in the application.
- Incremented application version to 0.7.9 and updated changelog to reflect new features.
- Added support for creating, updating, and deleting exercise variants via new API endpoints.
- Implemented functionality for reordering exercise variants, improving user experience in managing exercise options.
- Enhanced frontend components to display and manage exercise variants, including detailed information and editing capabilities.
- Incremented application version to 0.7.8 and updated database schema version to 20260427030.
- Added support for including exercise variants in the exercise listing API, improving training planning capabilities.
- Enhanced training unit creation and update logic to validate exercise variant IDs, ensuring proper associations.
- Updated frontend components to support exercise variant selection, improving user experience in training planning.
- Introduced multi-select functionality for filtering exercises by focus areas, style directions, training types, target groups, and skills, allowing users to select multiple options.
- Updated the ExercisesListPage to utilize the new multi-select component, improving the user experience for filtering exercises.
- Enhanced backend filtering logic to support new array-based query parameters, ensuring efficient handling of multiple filter criteria.
- Adjusted CSS styles for better layout and usability of the exercise filters.
- Added support for style direction mappings in the backend, allowing for improved categorization of exercises.
- Introduced a new function to normalize property synonyms, enhancing the mapping of exercise properties.
- Updated the exercise catalog assignment logic to include style directions, ensuring proper database entries.
- Enhanced the ExercisesListPage with new filtering options for style directions, improving user experience and search capabilities.
- Updated capability level mappings in the backend to reflect new terminology (e.g., "einsteiger" to "basis" and "experte" to "optimierung").
- Refactored the exercise management logic to normalize skill levels using canonical slugs, improving consistency across the application.
- Enhanced the ExercisesListPage with additional filtering options for style direction, training type, and target group, along with AI search capabilities.
- Incremented application version to 0.7.7 and updated changelog to document these changes.
- Introduced a new utility function to streamline SQL query construction for active status filtering, improving code reusability across multiple endpoints.
- Updated existing query logic in the catalogs and skills routers to utilize the new utility function, ensuring consistent handling of active status.
- Refactored the ExerciseFormPage to remove deprecated age group handling, simplifying the form structure.
- Enhanced the RichTextEditor component with improved link handling and formatting options for better user experience.
- Updated API utility functions to support new AI features for exercise suggestions and regeneration, expanding the capabilities of the exercise management system.
- Added support for training types in exercise creation and updates, allowing for better categorization of exercises.
- Implemented a rich text editor for exercise descriptions, improving content formatting capabilities.
- Updated the ExerciseDetailPage to display training types and enhanced the layout for better user experience.
- Refactored ExerciseFormPage to accommodate new multi-association fields for training styles, types, and target groups.
- Improved API payload handling to include training types and ensure proper data structure for exercise management.
- Enhanced the ExercisesListPage with improved loading and filtering functionalities for better performance.
- Introduced new API endpoints for managing exercise media, including upload, update, delete, and reorder functionalities.
- Updated the exercise creation and update logic to ensure goal and execution fields are validated and normalized.
- Refactored frontend components to support the new exercise media features, including a dedicated import section for complete stack files.
- Removed the deprecated ExercisesPage component and replaced it with a more modular structure for exercise management.
- Incremented database schema version to 20260427028 and updated changelog to reflect these changes.
- Incremented application version to 0.7.6 and updated maturity models version to 1.4.0.
- Introduced new API endpoints for exporting and importing matrix stack bundles, enhancing the capabilities for managing maturity models and context bindings.
- Updated frontend components to support the new matrix stack export and import features, including UI elements for stack management.
- Documented changes in the changelog for version 0.7.6, detailing the new matrix stack functionality and its usage.
- Incremented application version to 0.7.5 and updated maturity model version to 1.3.1.
- Improved binding logic to ensure that only relevant entries are considered based on the presence of context bindings.
- Updated documentation to clarify the behavior of binding resolution and its impact on legacy model resolution.
- Documented changes in the changelog for version 0.7.5, detailing the new binding resolution rules.
- Incremented application version to 0.7.4 and updated database schema version to 20260427027.
- Enhanced maturity model context bindings to support new filtering options for training styles.
- Introduced new API endpoints for importing and exporting maturity model bundles.
- Updated frontend components to include a matrix view and improved admin UI for managing maturity models.
- Documented changes in the changelog for version 0.7.4, detailing new features and improvements.
- Incremented application version to 0.7.3 and updated database schema version to 20260427026.
- Enhanced maturity model context bindings with new hierarchical resolution logic for focus areas, style directions, and training types.
- Added new API endpoints for managing maturity model context bindings.
- Updated frontend components to support the new context binding functionality and improved admin UI for better user experience.
- Documented changes in the changelog for version 0.7.3, including new features and improvements.
- Introduced endpoints for managing skill main categories, including CRUD operations.
- Enhanced skills catalog endpoint to support hierarchical sorting by main category and category.
- Updated frontend API utility functions to include new skill main category operations.
- Improved admin interface for skills management with new layout and styles.
- Documented changes in the changelog for better tracking of new features and updates.
- Incremented application version to 0.7.2 and updated database schema version to 20260427025.
- Enhanced maturity models functionality to support M:N relationships for focus areas, style directions, and target groups.
- Updated frontend to allow multi-selection for focus areas, style directions, and target groups.
- Documented changes in the changelog for version 0.7.2, including new migration details and UI improvements.
- Introduced new maturity models feature with CRUD operations in the API.
- Added routes and frontend components for managing maturity models.
- Updated version to 0.7.1 with corresponding build date and schema version.
- Enhanced admin navigation to include maturity models section.
- Documented changes in the changelog for version 0.7.1.
Fixes: 'no unique or exclusion constraint matching the ON CONFLICT specification'
ON CONFLICT (exercise_id, skill_id) requires UNIQUE constraint.
This was causing 91 import failures.
- Added imported_by parameter to _run_import and _upsert_exercise
- Exercises now automatically get created_by set to importing user
- Fixes visibility issue where imported exercises were invisible
Related: Wiki import - exercise visibility fix
- build_skill_assignments() now returns INTEGER (1-5) for target_level
- Previously returned string names ('einsteiger', 'grundlagen', etc.)
- Caused 91/95 import failures with 'invalid input syntax for type integer'
- Remaining 4 failures are wiki pages missing both goal AND execution (invalid data)
Issue: Wiki import - dict-cursor fixes phase 2
Problem 1: Reimport fails completely (all exercises fail)
Root cause: Line 465 existing[0] instead of existing['id']
Fix: Changed to existing['id'] for dict-cursor compatibility
Problem 2: 221 exercises skipped, only 2 in database
Root cause: Orphaned wiki_import_references from failed imports
Fix: New admin endpoint to manually cleanup orphaned references
New endpoints:
- DELETE /api/import/mediawiki/admin/cleanup-orphaned-references
Deletes all references where local_id doesn't exist in target table
Returns count of deleted references per type
- GET /api/import/mediawiki/admin/stats
Shows references vs. actual count + orphaned count
Helps diagnose import state issues
Usage:
1. Call cleanup endpoint to remove orphaned references
2. Run normal import (reimport=false)
3. Should import all previously failed exercises
Problem: 221 exercises skipped, but only 2 actually in database
Root cause: Failed imports created wiki_import_references entries,
but exercises were never saved (due to earlier bugs)
Duplicate check only verified references existed, not actual data.
Result: All subsequent imports skipped 'already imported' items.
Solution:
- Enhanced duplicate check to verify BOTH reference AND actual entity
- If reference exists but entity is missing → delete orphaned reference
- Item will be re-imported on same run (no manual cleanup needed)
Check logic:
1. Find reference in wiki_import_references
2. Check if exercises/skills/methods table has matching local_id
3. If both exist → skip (true duplicate)
4. If reference exists but entity missing → delete reference + re-import
This auto-heals broken state from previous failed imports.
Error: 100 exercises failed with error '0' (TypeError suppressed)
Root cause: More row[0] dict access in catalog assignment functions
Previous fix only covered fetchone()[0] in RETURNING clauses.
Missed 6 more locations in SELECT queries where row is dict-like.
Fixed locations:
- Line 511: focus_area_id in exercise_focus_areas INSERT
- Line 524: style_direction_id in exercise_training_styles INSERT
- Line 535: target_group_id in exercise_target_groups INSERT
- Line 546: skill_id in exercise_skills INSERT
- Line 568: skill_id in exercise_skills INSERT (with levels)
- Line 589: category_id assignment in _upsert_skill
All changed from row[0] to row['id'] for RealDictCursor compatibility.
This should fix the remaining 100 import failures.
Error: 224/225 exercises failed with NOT NULL constraint violations
Root cause: exercises table requires BOTH goal AND execution (NOT NULL)
Reality: Many wiki exercises have only ONE of these fields
Migration 019:
- ALTER COLUMN goal DROP NOT NULL
- ALTER COLUMN execution DROP NOT NULL
- ADD CHECK constraint: (goal IS NOT NULL OR execution IS NOT NULL)
This allows:
✓ Exercises with only goal
✓ Exercises with only execution
✓ Exercises with both
✗ Exercises with neither (CHECK constraint fails)
Import validation already correct (line 312):
required_ok = bool(mapped.get('goal') or mapped.get('execution'))
DB schema was blocking valid exercises.
Error: 500 Internal Server Error on execute import
Root cause: Using fetchone()[0] with RealDictCursor (dict-like rows)
PostgreSQL RealDictCursor returns dict-like objects, not tuples.
Accessing [0] on a dict throws TypeError.
Fix: Changed all fetchone()[0] to fetchone()['id']
Locations:
- Line 163: log_id after INSERT INTO wiki_import_log
- Line 485: ex_id after INSERT INTO exercises
- Line 599: skill_id after INSERT INTO skills
- Line 616: method_id after INSERT INTO training_methods
This matches the pattern used in other routers (exercises.py, etc.)
Error: column 'created' of relation 'profiles' does not exist
Fix: Changed 'created' to 'created_at' in INSERT statement
Line: backend/routers/auth.py:247
- Implemented a new SQL migration for wiki import tracking tables.
- Created an import router for handling MediaWiki imports of exercises, skills, and methods.
- Developed a Semantic MediaWiki API client for direct API interactions.
- Added a mapper to convert SMW properties to local database fields.
- Introduced background tasks for asynchronous import processing.
- Implemented logging and error handling for import operations.
- Added endpoints for previewing imports, checking import status, and managing import references.