def validate(self, attrs):
        if settings.LDAP_ENABLED and self.instance:
            # We only run into issues if using LDAP
            errors = OrderedDict()

            for attr, value in attrs.items():
                current_value = getattr(self.instance, attr)
                # Only deny the request if the field is LDAP managed AND is changed
                if LDAP_MANAGED_FIELDS in attr and value != current_value:
                    errors[attr] = ['This in an LDAP managed field.']

            if errors:
                raise serializers.ValidationError(errors)

        return attrs
dataset/ETHPy150Open stackdio/stackdio/stackdio/api/users/serializers.py/UserSerializer.validate/swapped operands of `in`