yasuki_core.accounts.users.ban_user#

ban_user(conn, user_id, reason=None)[source]#

Ban a live user: flag the row, revoke every session, and tombstone the identity.

The tombstone means the ban survives even if the user later deletes their account. Return whether a user was there to ban.

Parameters:
connpsycopg.Connection

An open accounts-database connection.

user_idint

The user to ban.

reasonstr, optional

A free-text ban reason, kept on the row and the tombstone. Default None.