sort string should start with letters or numbers, fixes #19

This commit is contained in:
j 2013-11-10 23:05:07 +00:00
parent 59460cdb85
commit ef3083ab2c

View file

@ -139,6 +139,8 @@ class Annotation(models.Model):
self.findvalue = ox.decode_html(ox.strip_tags(re.sub('<br */?>\n?', ' ', self.value))).replace('\n', ' ')
self.findvalue = unicodedata.normalize('NFKD', self.findvalue).lower()
sortvalue = sort_string(self.findvalue)
while sortvalue and not unicodedata.category(sortvalue[0])[0] in ('L', 'N'):
sortvalue = sortvalue[1:]
if sortvalue:
self.sortvalue = sortvalue[:900]
else: