Commit Graph

16 Commits

Author SHA1 Message Date
Quality App System
64b67b2979 Implement database connection pooling with context manager pattern
- Added DBUtils PooledDB for intelligent connection pooling
- Created db_pool.py with lazy-initialized connection pool (max 20 connections)
- Added db_connection_context() context manager for safe connection handling
- Refactored all 19 database operations to use context manager pattern
- Ensures proper connection cleanup and exception handling
- Prevents connection exhaustion on POST requests
- Added logging configuration for debugging

Changes:
- py_app/app/db_pool.py: New connection pool manager
- py_app/app/logging_config.py: Centralized logging
- py_app/app/__init__.py: Updated to use connection pool
- py_app/app/routes.py: Refactored all DB operations to use context manager
- py_app/app/settings.py: Updated settings handlers
- py_app/requirements.txt: Added DBUtils dependency

This solves the connection timeout issues experienced with the fgscan page.
2026-01-22 22:07:06 +02:00
Quality App Developer
07614cf0bb Fix: Resolve newly created users unable to login - Add modules column support to user creation and login flow
Changes:
1. Fixed create_user_handler to properly initialize modules JSON for new users
2. Fixed edit_user_handler to manage module assignments instead of non-existent email field
3. Updated settings_handler to select modules column instead of email from users table
4. Added validate_and_repair_user_modules function in setup_complete_database.py to ensure all users have correct module assignments
5. Added create_app_license function to create development license file during database setup
6. Added ensure_app_license function to docker-entrypoint.sh for license creation on container startup
7. Added user modules validation on Flask app startup to repair any malformed modules
8. License file is automatically created with 1-year validity on deployment

This ensures:
- New users created via UI get proper module assignments
- Existing users are validated/repaired on app startup
- Non-superadmin users can login after license check passes
- All deployments have a valid development license by default
2026-01-09 13:45:08 +02:00
Quality App Developer
d09bf34e85 Fix superadmin access control and modal aria-hidden warning
- Implement role normalization system to handle role name variants (superadmin, super_admin, administrator)
- Add session persistence configuration (PERMANENT_SESSION_LIFETIME = 7 days)
- Add modules JSON column to users database table schema
- Update setup script with backward compatibility check for modules column
- Fix user_management_simple route to properly fetch and display modules
- Resolve modal aria-hidden accessibility warning by managing focus on close button
- All changes deployed and tested successfully
2025-12-26 20:08:54 +02:00
Quality App Developer
a8824d6f69 updated code 2025-12-25 22:45:22 +02:00
ske087
1a3e26d86d updated to set boxes , and updated to fill boxes 2025-12-10 22:30:52 +02:00
ske087
7912885046 User management and module improvements
- Added daily_mirror module to permissions system
- Fixed user module management - updates now work correctly
- Implemented dashboard module filtering based on user permissions
- Fixed warehouse create_locations page (config parser and delete)
- Implemented POST-Redirect-GET pattern to prevent duplicate entries
- Added application license system with validation middleware
- Cleaned up debug logging code
- Improved user module selection with fetch API instead of form submit
2025-11-29 14:16:36 +02:00
Quality System Admin
c91b7d0a4d Fixed the scan error and backup problems 2025-11-05 21:25:02 +02:00
Quality System Admin
9c19379810 updated backups solution 2025-11-03 22:18:56 +02:00
Quality System Admin
1ade0b5681 updated documentation folder 2025-11-03 21:17:10 +02:00
Quality System Admin
8d47e6e82d updated structure and app 2025-11-03 19:48:53 +02:00
957c8eca4d moved to test environment 2025-10-05 14:32:47 -04:00
2b84b13524 Register warehouse blueprint and update dashboard for warehouse module integration. 2025-09-10 21:48:51 +03:00
56f3f8805d updated to modul etichete 2025-04-30 11:57:48 +03:00
9244ff90f6 added scan page 2025-04-17 15:02:08 +03:00
d3b29052e8 created user settings in the settings page 2025-04-17 10:00:46 +03:00
db465d6e4e login and dashboard pages 2025-04-16 16:44:21 +03:00