#!/usr/bin/env python3 """Temporary endpoint to fix admin password encoding""" dbname = get_module_dbname('rbac') encoded_pw = password_encode('admin123') async with DBPools().sqlorContext(dbname) as sor: await sor.sqlExe( "UPDATE users SET password=${password}$ WHERE username='admin'", {'password': encoded_pw} ) # Verify r = await sor.sqlExe("SELECT id, username, password FROM users WHERE username='admin'", {}) result = {'status': 'ok', 'encoded': encoded_pw, 'updated': len(r) if r else 0} return json.dumps(result, ensure_ascii=False)