FG Scan form validation improvements with warehouse module updates
- Fixed 3 JavaScript syntax errors in fg_scan.html (lines 951, 840-950, 1175-1215) - Restored form field validation with proper null safety checks - Re-enabled auto-advance between form fields - Re-enabled CP code auto-complete with hyphen detection - Updated validation error messages with clear format specifications and examples - Added autocomplete='off' to all input fields - Removed auto-prefix correction feature - Updated warehouse routes and modules for box assignment workflow - Added/improved database initialization scripts - Updated requirements.txt dependencies Format specifications implemented: - Operator Code: OP + 2 digits (example: OP01, OP99) - CP Code: CP + 8 digits + hyphen + 4 digits (example: CP00000000-0001) - OC1/OC2 Codes: OC + 2 digits (example: OC01, OC99) - Defect Code: 3 digits only
This commit is contained in:
@@ -3,6 +3,7 @@ Quality App v2 - Flask Application Factory
|
||||
Robust, modular application with login, dashboard, and multiple modules
|
||||
"""
|
||||
from flask import Flask
|
||||
from flask_session import Session
|
||||
from datetime import datetime, timedelta
|
||||
import os
|
||||
import logging
|
||||
@@ -35,6 +36,18 @@ def create_app(config=None):
|
||||
app.config['SESSION_COOKIE_SECURE'] = False # Set True in production with HTTPS
|
||||
app.config['SESSION_COOKIE_HTTPONLY'] = True
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'
|
||||
app.config['SESSION_COOKIE_NAME'] = 'quality_app_session'
|
||||
app.config['SESSION_REFRESH_EACH_REQUEST'] = True
|
||||
|
||||
# Use filesystem for session storage (works with multiple gunicorn workers)
|
||||
sessions_dir = os.path.join(app.config.get('LOG_DIR', '/app/data/logs'), '..', 'sessions')
|
||||
os.makedirs(sessions_dir, exist_ok=True)
|
||||
app.config['SESSION_TYPE'] = 'filesystem'
|
||||
app.config['SESSION_FILE_DIR'] = sessions_dir
|
||||
app.config['SESSION_FILE_THRESHOLD'] = 500
|
||||
|
||||
# Initialize Flask-Session
|
||||
Session(app)
|
||||
|
||||
# Initialize database connection
|
||||
logger.info("Initializing database connection...")
|
||||
|
||||
Reference in New Issue
Block a user