|
4 | 4 | import email.utils |
5 | 5 | import email.header |
6 | 6 | from hashids import Hashids |
7 | | -from unidecode import unidecode |
8 | 7 | from urlparse import urljoin |
9 | 8 |
|
10 | 9 | from django.conf import settings |
|
21 | 20 | from ietf.utils.mail import send_mail_preformatted |
22 | 21 | from ietf.utils.storage import NoLocationMigrationFileSystemStorage |
23 | 22 | from ietf.utils.mail import formataddr |
| 23 | +from ietf.utils.text import unidecode_name |
24 | 24 |
|
25 | 25 |
|
26 | 26 | class PersonInfo(models.Model): |
@@ -61,18 +61,18 @@ def ascii_name(self): |
61 | 61 | # we're validating the content of the ascii field, and have |
62 | 62 | # verified that the field is ascii clean in the database: |
63 | 63 | if not all(ord(c) < 128 for c in self.ascii): |
64 | | - self._cached_ascii_name = unidecode(self.ascii).strip() |
| 64 | + self._cached_ascii_name = unidecode_name(self.ascii) |
65 | 65 | else: |
66 | 66 | self._cached_ascii_name = self.ascii |
67 | 67 | else: |
68 | | - self._cached_ascii_name = unidecode(self.plain_name()).strip() |
| 68 | + self._cached_ascii_name = unidecode_name(self.plain_name()) |
69 | 69 | return self._cached_ascii_name |
70 | 70 | def plain_ascii(self): |
71 | 71 | if not hasattr(self, '_cached_plain_ascii'): |
72 | 72 | if self.ascii: |
73 | | - ascii = unidecode(self.ascii).strip() |
| 73 | + ascii = unidecode_name(self.ascii) |
74 | 74 | else: |
75 | | - ascii = unidecode(self.name).strip() |
| 75 | + ascii = unidecode_name(self.name) |
76 | 76 | prefix, first, middle, last, suffix = name_parts(ascii) |
77 | 77 | self._cached_plain_ascii = u" ".join([first, last]) |
78 | 78 | return self._cached_plain_ascii |
|
0 commit comments