Exemple #1
0
 def __call__(self, form, field):
     non_gsm_characters = sorted(
         list(get_non_gsm_compatible_characters(field.data)))
     if non_gsm_characters:
         raise ValidationError(
             'You can’t use {} in text messages. {} won’t show up properly on everyone’s phones.'
             .format(
                 formatted_list(non_gsm_characters,
                                conjunction='or',
                                before_each='',
                                after_each=''),
                 ('It' if len(non_gsm_characters) == 1 else 'They')))
 def __call__(self, form, field):
     non_sms_characters = sorted(list(SanitiseSMS.get_non_compatible_characters(field.data)))
     if non_sms_characters:
         raise ValidationError(
             "You can’t use {} in text messages. {} won’t show up properly on everyone’s phones.".format(
                 formatted_list(
                     non_sms_characters,
                     conjunction="or",
                     before_each="",
                     after_each="",
                 ),
                 ("It" if len(non_sms_characters) == 1 else "They"),
             )
         )