def METHOD_NAME(self, request, obj):
    if obj.archived_at is not None:
        messages.error(
            request,
            f"Error: Cannot archive. {obj.__class__.__name__}"
            f"  {obj} is already archived.",
        )
    else:
        try:
            obj.archive()
        except ValidationError as error:
            messages.error(
                request, f"Error: Could not archive {obj}.\n{str(error)}"
            )
        else:
            messages.success(request, f"Success: Archived {obj}.")