def METHOD_NAME(sender, instance, created, **kwargs):
    if not hasattr(instance, "ldap_user"):
        return
    sigla_servico = instance.ldap_user.attrs.get("department", [""])[0].split(
        "-"
    )[-1]
    servico = Servico.objects.filter(sigla=sigla_servico).first()
    if created and instance.is_staff:
        Servidor.objects.create(
            user=instance,
            nome_completo="%s %s" % (instance.first_name, instance.last_name),
            servico=servico,
        )
    elif (
        not created
        and instance.is_staff
        and instance.servidor is not None
        and instance.servidor.servico != servico
    ):
        servidor = instance.servidor
        servidor.servico = servico
        servidor.save()