(self, value)
return value
Ensure that VPN can't be added when
        template `Type` is set to `Generic`.
Ensure that VPN can't be added when
        template `Type` is set to `Generic`.
Ensure that VPN can t be added when template Type is set to Generic .
def validate_vpn(self, value):
        """
        Ensure that VPN can't be added when
        template `Type` is set to `Generic`.
        """
        if self.initial_data.get('type') == 'generic' and value is not None:
            raise serializers.ValidationError(
                _("To select a VPN, set the template type to 'VPN-client'")
            )
        return value
def validate_vpn ( self , value ) : if self . initial_data . get ( 'type' ) == 'generic' and value is not None : raise serializers . ValidationError ( _ ( "To select a VPN, set the template type to 'VPN-client'" ) ) return value