25 lines
603 B
Python
25 lines
603 B
Python
"""Quick script to make Lou an admin."""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
|
|
from app.core.database import SessionLocal
|
|
from app.models.user import User
|
|
|
|
def make_lou_admin():
|
|
db = SessionLocal()
|
|
try:
|
|
lou = db.query(User).filter(User.username == "lou").first()
|
|
if lou:
|
|
lou.is_admin = True
|
|
db.commit()
|
|
print(f"✅ {lou.full_name} is now an admin!")
|
|
else:
|
|
print("❌ Lou not found in database")
|
|
finally:
|
|
db.close()
|
|
|
|
if __name__ == "__main__":
|
|
make_lou_admin()
|