Spaces:
Running
Running
File size: 1,163 Bytes
73f232b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | import asyncio
import sys
import os
# Add parent dir to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from sqlmodel import select
from app.core.database import async_session_maker
from app.models.user import User
async def verify_admin():
email = "axeroni.s2@gmail.com"
print(f"Verifying user: {email}")
async with async_session_maker() as session:
# Check if user exists
statement = select(User).where(User.email == email)
result = await session.execute(statement)
user = result.scalars().first()
if not user:
print(f"User {email} not found!")
return
# Update verification status
if not user.is_verified:
user.is_verified = True
session.add(user)
await session.commit()
print(f"User {email} has been manually VERIFIED.")
else:
print(f"User {email} is ALREADY verified.")
if __name__ == "__main__":
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(verify_admin())
|