moo.sdk.audit.record_action

moo.sdk.audit.record_action(action, target=None, detail='', actor=None, force=False)

Append one consequential action to the audit log.

Parameters:
  • action – one of AuditLog’s action constants

  • target – the affected Object (or None); recorded by pk and a name snapshot so the row survives the target’s deletion

  • detail – optional free-text / serialized context

  • actor – the acting Player account; defaults to the current account

  • force – record even when no human actor is resolvable (used by staff-initiated sanctions that must always be logged)

Returns:

the created AuditLog row, or None if skipped