def is_errant_log(log):
    """The approve_registration script saves 2 log types:
    - PROJECT_REGISTERED
    - REGISTRATION_APPROVAL_APPROVED
    """
    return (
        # Log already migrated
        log.should_hide is not True and
        (
            mdl.NodeLog.PROJECT_REGISTERED in log.action
            # The user is None because the
            # approve_registration script calls
            # _on_complete with user=None
            and log.user is None
            # Script is run at 12AM EST or 4:00 UTC
            # Yes, this is ugly, but there is no other way to distinguish
            # a log generated by the approve_registration script or a
            # log generated by a manual approval. Unlike PROJECT_REGISTERED logs,
            # these will have a user associated with them
            and log.date.hour == 4
            and log.date.minute == 0
        ) or
        (
            log.action in mdl.NodeLog.REGISTRATION_APPROVAL_APPROVED
            and log.date.hour == 4
            and log.date.minute == 0
        )
    )
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/hide_extra_registration_logs.py/is_errant_log/swapped operands of `in`