equal
deleted
inserted
replaced
132 Throws a `VMMError` if the local-part is too long or contains |
132 Throws a `VMMError` if the local-part is too long or contains |
133 invalid characters. |
133 invalid characters. |
134 |
134 |
135 """ |
135 """ |
136 if len(localpart) > 64: |
136 if len(localpart) > 64: |
137 raise VMMError(_(u'The local-part %r is too long') % localpart, |
137 raise VMMError(_(u"The local-part '%s' is too long") % localpart, |
138 LOCALPART_TOO_LONG) |
138 LOCALPART_TOO_LONG) |
139 invalid_chars = set(RE_LOCALPART.findall(localpart)) |
139 invalid_chars = set(RE_LOCALPART.findall(localpart)) |
140 if invalid_chars: |
140 if invalid_chars: |
141 i_chars = u''.join((u'"%s" ' % c for c in invalid_chars)) |
141 i_chars = u''.join((u'"%s" ' % c for c in invalid_chars)) |
142 raise VMMError(_(u"The local-part %(l_part)r contains invalid \ |
142 raise VMMError(_(u"The local-part '%(l_part)s' contains invalid \ |
143 characters: %(i_chars)s") % |
143 characters: %(i_chars)s") % |
144 {'l_part': localpart, 'i_chars': i_chars}, |
144 {'l_part': localpart, 'i_chars': i_chars}, |
145 LOCALPART_INVALID) |
145 LOCALPART_INVALID) |
146 return localpart |
146 return localpart |
147 |
147 |