looks good.
The code has been migrated to SQLAlchemy.
Please note that blocking a user has other effects, such as: