fix save place

This commit is contained in:
j 2017-02-25 11:18:59 +01:00
parent 50bb40291c
commit 67b2fd698b
2 changed files with 3 additions and 3 deletions

View file

@ -314,7 +314,7 @@ def editAnnotation(request, data):
setattr(a, { setattr(a, {
'in': 'start', 'in': 'start',
'out': 'end' 'out': 'end'
}.get(key,key), value) }.get(key, key), value)
add_changelog(request, data) add_changelog(request, data)
a.save() a.save()
#update sort/find tables async #update sort/find tables async

View file

@ -151,7 +151,7 @@ class Place(models.Model):
self.geoname_sort = ', '.join(reversed(self.geoname.split(', '))) self.geoname_sort = ', '.join(reversed(self.geoname.split(', ')))
self.name_find = '|%s|' % '|'.join([self.name]+list(self.alternativeNames)).lower() self.name_find = '|%s|' % '|'.join([self.name]+list(self.alternativeNames)).lower()
self.defined = len(filter(None, [getattr(self, key) self.defined = len(list(filter(None, [getattr(self, key)
for key in ('south', 'west', 'north', 'east')])) > 0 for key in ('south', 'west', 'north', 'east')]))) > 0
super(Place, self).save(*args, **kwargs) super(Place, self).save(*args, **kwargs)