strip tags from annotation.sortvalue

This commit is contained in:
j 2011-11-03 12:44:53 +01:00
parent 7eeb6dc107
commit af2c26a36a

View file

@ -58,9 +58,15 @@ class Annotation(models.Model):
def save(self, *args, **kwargs):
set_public_id = not self.id or not self.public_id
self.sortvalue = None
if self.value.strip():
self.sortvalue = sort_string(self.value)[:1000]
if self.value:
sortvalue = ox.stripTags(self.value).strip()
sortvalue = sort_string(sortvalue)
if sortvalue:
self.sortvalue = sortvalue[:1000]
else:
self.sortvalue = None
else:
self.sortvalue = None
#no clip or update clip
def get_layer(id):