def METHOD_NAME(invited_user, organisation, group, inviting_user):
    if invited_user.is_active:
        # For active users, we know their email address is correct so we approve their new
        # employment immediately. They'll get a mail that their employment is approved.
        employment, created = Employment.objects.get_or_create(
            user=invited_user,
            organisation=organisation,
            group=group,
            # NOTE: Create approved employment to avoid sending 'organisation request' mail
            defaults=dict(is_approved=True)
        )
        if created:
            # HACK: We force approve to log, instead of manually logging.
            # Creating an unapproved employment, to start with, isn't ideal
            # since this would send approval requests to a bunch of users with
            # the permissions to approve.
            employment.is_approved = False
            employment.approve(inviting_user)
        elif not employment.is_approved:
            # Approve the existing unapproved employment
            employment.approve(inviting_user)
        else:
            return False
    else:
        # Create an unapproved employment for inactive users
        employment, __ = Employment.objects.get_or_create(
            user=invited_user,
            organisation=organisation,
            group=group,
        )
        send_user_invitation(invited_user.email, inviting_user, invited_user, employment)
    return True