File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ from app .main import create_app
3+ from app .models import db , User
4+
5+ app = create_app ()
6+
7+ with app .app_context ():
8+ print ("\n === User Debug Info ===" )
9+ users = User .query .all ()
10+
11+ for user in users :
12+ print (f"\n User: { user .username } " )
13+ print (f" ID: { user .id } " )
14+ print (f" Admin: { user .is_admin } " )
15+ print (f" Has encryption key: { bool (user .encryption_key )} " )
16+ print (f" DA Server: { user .da_server } " )
17+ print (f" DA Username: { user .da_username } " )
18+ print (f" Has DA Password: { bool (user .da_password_encrypted )} " )
19+ print (f" DA Domain: { user .da_domain } " )
20+
21+ # Fix missing encryption keys
22+ if not user .encryption_key :
23+ print (" [!] Generating missing encryption key..." )
24+ user .generate_encryption_key ()
25+ db .session .commit ()
26+ print (" [✓] Encryption key generated" )
27+
28+ print ("\n === Debug complete ===" )
You can’t perform that action at this time.
0 commit comments