Spaces:
Paused
Paused
Download scratch/reset_admin.py from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scratch/reset_admin.py
- Command line
-
hf download hf://spaces/3SCError404/nexus/scratch/reset_admin.py
-
curl -L -o reset_admin.py https://huggingface.co/spaces/3SCError404/nexus/resolve/main/scratch/reset_admin.py
543 Bytes
| import asyncio | |
| from core.database import async_session_factory | |
| from sqlalchemy import update | |
| from models.user import User | |
| from core.security import get_password_hash | |
| async def reset_admin(): | |
| async with async_session_factory() as db: | |
| await db.execute( | |
| update(User) | |
| .where(User.email == "admin@3sc.com") | |
| .values(hashed_password=get_password_hash("Admin@3sc")) | |
| ) | |
| await db.commit() | |
| print("Password reset successful.") | |
| if __name__ == "__main__": | |
| asyncio.run(reset_admin()) | |