if '_persistence_id' in kwargs:

Should be enough.