Files
Church-Music/legacy-site/backend/update_hop_password.py

27 lines
614 B
Python

#!/usr/bin/env python3
"""
Quick script to update existing user password to bcrypt
"""
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
from postgresql_models import SessionLocal, User
db = SessionLocal()
try:
user = db.query(User).filter(User.username == 'hop').first()
if user:
user.set_password('hop@2026ilovejesus')
db.commit()
print(f"✓ Updated password for user 'hop' to bcrypt")
else:
print("User 'hop' not found")
sys.exit(1)
except Exception as e:
print(f"Error: {e}")
db.rollback()
sys.exit(1)
finally:
db.close()