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

@ -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)