(rid: int)
| 17604 | conn.execute("INSERT OR IGNORE INTO users(username, pw_hash, is_admin, created_at) VALUES(?,?,0,?)", |
| 17605 | (row["username"], row["pw_hash"], now_z())) |
| 17606 | conn.execute("UPDATE pending_users SET status='approved' WHERE username=?", (username,)) |
| 17607 | conn.commit() |
| 17608 | user_root(username) |
| 17609 | ensure_profile_row(username) |
| 17610 | try: |
| 17611 | set_profile(username, username, "", []) |
| 17612 | except Exception: |
| 17613 | pass |
| 17614 | sys.stdout.write(f"[ButSystem] Approved: {username}\n") |
| 17615 | else: |
| 17616 | conn.execute("UPDATE pending_users SET status='denied' WHERE username=?", (username,)) |
| 17617 | conn.commit() |
| 17618 | sys.stdout.write(f"[ButSystem] Denied: {username}\n") |
| 17619 | sys.stdout.flush() |
| 17620 | conn.close() |
| 17621 | except Exception as e: |
| 17622 | log.exception("Approval prompt error: %s", e) |
| 17623 | try: |
| 17624 | sys.stdout.write("[ButSystem] Approval error (see logs).\n") |
| 17625 | sys.stdout.flush() |
nothing calls this directly
no test coverage detected