Spaces:
Configuration error
Configuration error
| #!/usr/bin/env python3 | |
| """ | |
| Check all users and their profiles. | |
| """ | |
| from models import db, User, Introduction, WorkExperience, Project, Education, Skill, Achievement | |
| from app import app | |
| def check_all_profiles(): | |
| """Check all users and their profile data.""" | |
| with app.app_context(): | |
| users = User.query.all() | |
| print(f"Total users: {len(users)}") | |
| for user in users: | |
| print(f"\nUser: {user.email} (ID: {user.id})") | |
| # Check introduction | |
| intro = Introduction.query.filter_by(user_id=user.id).first() | |
| print(f" Has introduction: {'Yes' if intro else 'No'}") | |
| if intro: | |
| print(f" Name: {intro.name}") | |
| # Check profile summary | |
| from models import ProfileSummary | |
| summary = ProfileSummary.query.filter_by(user_id=user.id).first() | |
| print(f" Has profile summary: {'Yes' if summary else 'No'}") | |
| # Check other sections | |
| work_count = WorkExperience.query.filter_by(user_id=user.id).count() | |
| project_count = Project.query.filter_by(user_id=user.id).count() | |
| education_count = Education.query.filter_by(user_id=user.id).count() | |
| skill_count = Skill.query.filter_by(user_id=user.id).count() | |
| achievement_count = Achievement.query.filter_by(user_id=user.id).count() | |
| print(f" Work experiences: {work_count}") | |
| print(f" Projects: {project_count}") | |
| print(f" Education: {education_count}") | |
| print(f" Skills: {skill_count}") | |
| print(f" Achievements: {achievement_count}") | |
| if __name__ == "__main__": | |
| check_all_profiles() |