def clean_ldap_user_dn_template(self):
        tpl = self.cleaned_data["ldap_user_dn_template"]
        try:
            test = tpl % {"user": "toto"}
        except (__HOLE__, ValueError):
            raise forms.ValidationError(_("Invalid syntax"))
        return tpl
dataset/ETHPy150Open tonioo/modoboa/modoboa/core/app_settings.py/GeneralParametersForm.clean_ldap_user_dn_template